Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
62099da
[CLI] Initial implementation for batch generation
jimschubert Aug 28, 2019
473ca5f
Allow for path-relative outputs
jimschubert Sep 7, 2019
d4ea07b
Add batch JSON objects
jimschubert Sep 7, 2019
e374397
write out the output directory in console
jimschubert Sep 7, 2019
68f2d9f
Change outputDir
jimschubert Sep 7, 2019
c6c4d81
Include INFO log about threads used and includes/root
jimschubert Sep 30, 2019
92d7b9f
Merge branch 'master' into batch-generation
jimschubert Sep 30, 2019
d2cd084
[Samples] Regenerate via ensure-up-to-date
jimschubert Sep 30, 2019
b5f16e9
Fixing dart generations
jimschubert Oct 4, 2019
542cc97
Delete stale "swagger" directory
jimschubert Oct 4, 2019
6a0133d
jwt headless in ensure-up-to-date
jimschubert Oct 4, 2019
f32da0e
Rename numberedbin/ci/java generators to match their outputs
jimschubert Oct 4, 2019
777b87c
Include ruby faraday in bin/ci
jimschubert Oct 4, 2019
9a3e954
Regenerate faraday for OAS 2
jimschubert Oct 4, 2019
dbb08af
Ignore csharp test csproj on generate
jimschubert Oct 4, 2019
b71df42
Minor refactoring
jimschubert Oct 5, 2019
28a3c2c
Ensure GlobalSettings.reset()
jimschubert Oct 5, 2019
0b7b5b9
Minor refactoring
jimschubert Oct 5, 2019
5f7b046
Improved thread-safety of ModelUtils
jimschubert Oct 5, 2019
27ada22
Merge branch 'master' into batch-generation
jimschubert Oct 6, 2019
a9ff022
Change dart windows scripts to openapi/openapi-generator
jimschubert Oct 6, 2019
c69726e
Regenerate samples
jimschubert Oct 6, 2019
19bfc69
Regenerate samples
jimschubert Oct 6, 2019
262a413
Include kotlin generation settings from previous contributions from b…
jimschubert Oct 6, 2019
8ecc146
Include kotlin multiplatform in CI samples generation
jimschubert Oct 6, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[Samples] Regenerate via ensure-up-to-date
  • Loading branch information
jimschubert committed Sep 30, 2019
commit d2cd084aa29504bf1493224f0318ec0328c90da0
Original file line number Diff line number Diff line change
Expand Up @@ -1491,6 +1491,9 @@ components:
maxLength: 64
minLength: 10
type: string
BigDecimal:
format: number
type: string
required:
- byte
- date
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Name | Type | Description | Notes
**DateTime** | Pointer to [**time.Time**](time.Time.md) | | [optional]
**Uuid** | Pointer to **string** | | [optional]
**Password** | Pointer to **string** | |
**BigDecimal** | Pointer to **float64** | | [optional]

## Methods

Expand Down Expand Up @@ -345,6 +346,31 @@ HasPassword returns a boolean if a field has been set.

SetPassword gets a reference to the given string and assigns it to the Password field.

### GetBigDecimal

`func (o *FormatTest) GetBigDecimal() float64`

GetBigDecimal returns the BigDecimal field if non-nil, zero value otherwise.

### GetBigDecimalOk

`func (o *FormatTest) GetBigDecimalOk() (float64, bool)`

GetBigDecimalOk returns a tuple with the BigDecimal field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.

### HasBigDecimal

`func (o *FormatTest) HasBigDecimal() bool`

HasBigDecimal returns a boolean if a field has been set.

### SetBigDecimal

`func (o *FormatTest) SetBigDecimal(v float64)`

SetBigDecimal gets a reference to the given float64 and assigns it to the BigDecimal field.


[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ type FormatTest struct {

Password *string `json:"password,omitempty"`

BigDecimal *float64 `json:"BigDecimal,omitempty"`

}

// GetInteger returns the Integer field if non-nil, zero value otherwise.
Expand Down Expand Up @@ -473,6 +475,39 @@ func (o *FormatTest) SetPassword(v string) {
o.Password = &v
}

// GetBigDecimal returns the BigDecimal field if non-nil, zero value otherwise.
func (o *FormatTest) GetBigDecimal() float64 {
if o == nil || o.BigDecimal == nil {
var ret float64
return ret
}
return *o.BigDecimal
}

// GetBigDecimalOk returns a tuple with the BigDecimal field if it's non-nil, zero value otherwise
// and a boolean to check if the value has been set.
func (o *FormatTest) GetBigDecimalOk() (float64, bool) {
if o == nil || o.BigDecimal == nil {
var ret float64
return ret, false
}
return *o.BigDecimal, true
}

// HasBigDecimal returns a boolean if a field has been set.
func (o *FormatTest) HasBigDecimal() bool {
if o != nil && o.BigDecimal != nil {
return true
}

return false
}

// SetBigDecimal gets a reference to the given float64 and assigns it to the BigDecimal field.
func (o *FormatTest) SetBigDecimal(v float64) {
o.BigDecimal = &v
}


// MarshalJSON returns the JSON representation of the model.
func (o FormatTest) MarshalJSON() ([]byte, error) {
Expand Down Expand Up @@ -528,6 +563,9 @@ func (o FormatTest) MarshalJSON() ([]byte, error) {
if o.Password != nil {
toSerialize["password"] = o.Password
}
if o.BigDecimal != nil {
toSerialize["BigDecimal"] = o.BigDecimal
}
return json.Marshal(toSerialize)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
import openapitools.OpenAPIUtils;
import com.fasterxml.jackson.core.type.TypeReference;

import java.util.concurrent.CompletionStage;
import java.util.concurrent.CompletableFuture;

import javax.validation.constraints.*;
import play.Configuration;

Expand All @@ -38,7 +41,7 @@ private PetApiController(Configuration configuration, PetApiControllerImpInterfa


@ApiAction
public Result addPet() throws Exception {
public CompletionStage<Result> addPet() throws Exception {
JsonNode nodebody = request().body().asJson();
Pet body;
if (nodebody != null) {
Expand All @@ -49,25 +52,29 @@ public Result addPet() throws Exception {
} else {
throw new IllegalArgumentException("'body' parameter is required");
}
imp.addPet(body);
return ok();
return CompletableFuture.supplyAsync(() -> {
imp.addPet(body)
return ok();
});
}

@ApiAction
public Result deletePet(Long petId) throws Exception {
public CompletionStage<Result> deletePet(Long petId) throws Exception {
String valueapiKey = request().getHeader("api_key");
String apiKey;
if (valueapiKey != null) {
apiKey = valueapiKey;
} else {
apiKey = null;
}
imp.deletePet(petId, apiKey);
return ok();
return CompletableFuture.supplyAsync(() -> {
imp.deletePet(petId, apiKey)
return ok();
});
}

@ApiAction
public Result findPetsByStatus() throws Exception {
public CompletionStage<Result> findPetsByStatus() throws Exception {
String[] statusArray = request().queryString().get("status");
if (statusArray == null) {
throw new IllegalArgumentException("'status' parameter is required");
Expand All @@ -80,18 +87,22 @@ public Result findPetsByStatus() throws Exception {
status.add(curParam);
}
}
List<Pet> obj = imp.findPetsByStatus(status);
if (configuration.getBoolean("useOutputBeanValidation")) {
for (Pet curItem : obj) {
OpenAPIUtils.validate(curItem);
CompletionStage<List<Pet>> stage = imp.findPetsByStatus(status).thenApply(obj -> {
if (configuration.getBoolean("useOutputBeanValidation")) {
for (Pet curItem : obj) {
OpenAPIUtils.validate(curItem);
}
}
}
JsonNode result = mapper.valueToTree(obj);
return ok(result);
return obj;
});
stage.thenApply(obj -> {
JsonNode result = mapper.valueToTree(obj);
return ok(result);
});
}

@ApiAction
public Result findPetsByTags() throws Exception {
public CompletionStage<Result> findPetsByTags() throws Exception {
String[] tagsArray = request().queryString().get("tags");
if (tagsArray == null) {
throw new IllegalArgumentException("'tags' parameter is required");
Expand All @@ -104,28 +115,36 @@ public Result findPetsByTags() throws Exception {
tags.add(curParam);
}
}
List<Pet> obj = imp.findPetsByTags(tags);
if (configuration.getBoolean("useOutputBeanValidation")) {
for (Pet curItem : obj) {
OpenAPIUtils.validate(curItem);
CompletionStage<List<Pet>> stage = imp.findPetsByTags(tags).thenApply(obj -> {
if (configuration.getBoolean("useOutputBeanValidation")) {
for (Pet curItem : obj) {
OpenAPIUtils.validate(curItem);
}
}
}
JsonNode result = mapper.valueToTree(obj);
return ok(result);
return obj;
});
stage.thenApply(obj -> {
JsonNode result = mapper.valueToTree(obj);
return ok(result);
});
}

@ApiAction
public Result getPetById(Long petId) throws Exception {
Pet obj = imp.getPetById(petId);
if (configuration.getBoolean("useOutputBeanValidation")) {
OpenAPIUtils.validate(obj);
}
JsonNode result = mapper.valueToTree(obj);
return ok(result);
public CompletionStage<Result> getPetById(Long petId) throws Exception {
CompletionStage<Pet> stage = imp.getPetById(petId).thenApply(obj -> {
if (configuration.getBoolean("useOutputBeanValidation")) {
OpenAPIUtils.validate(obj);
}
return obj;
});
stage.thenApply(obj -> {
JsonNode result = mapper.valueToTree(obj);
return ok(result);
});
}

@ApiAction
public Result updatePet() throws Exception {
public CompletionStage<Result> updatePet() throws Exception {
JsonNode nodebody = request().body().asJson();
Pet body;
if (nodebody != null) {
Expand All @@ -136,12 +155,14 @@ public Result updatePet() throws Exception {
} else {
throw new IllegalArgumentException("'body' parameter is required");
}
imp.updatePet(body);
return ok();
return CompletableFuture.supplyAsync(() -> {
imp.updatePet(body)
return ok();
});
}

@ApiAction
public Result updatePetWithForm(Long petId) throws Exception {
public CompletionStage<Result> updatePetWithForm(Long petId) throws Exception {
String valuename = (request().body().asMultipartFormData().asFormUrlEncoded().get("name"))[0];
String name;
if (valuename != null) {
Expand All @@ -156,12 +177,14 @@ public Result updatePetWithForm(Long petId) throws Exception {
} else {
status = null;
}
imp.updatePetWithForm(petId, name, status);
return ok();
return CompletableFuture.supplyAsync(() -> {
imp.updatePetWithForm(petId, name, status)
return ok();
});
}

@ApiAction
public Result uploadFile(Long petId) throws Exception {
public CompletionStage<Result> uploadFile(Long petId) throws Exception {
String valueadditionalMetadata = (request().body().asMultipartFormData().asFormUrlEncoded().get("additionalMetadata"))[0];
String additionalMetadata;
if (valueadditionalMetadata != null) {
Expand All @@ -170,11 +193,15 @@ public Result uploadFile(Long petId) throws Exception {
additionalMetadata = null;
}
Http.MultipartFormData.FilePart file = request().body().asMultipartFormData().getFile("file");
ModelApiResponse obj = imp.uploadFile(petId, additionalMetadata, file);
if (configuration.getBoolean("useOutputBeanValidation")) {
OpenAPIUtils.validate(obj);
}
JsonNode result = mapper.valueToTree(obj);
return ok(result);
CompletionStage<ModelApiResponse> stage = imp.uploadFile(petId, additionalMetadata, file).thenApply(obj -> {
if (configuration.getBoolean("useOutputBeanValidation")) {
OpenAPIUtils.validate(obj);
}
return obj;
});
stage.thenApply(obj -> {
JsonNode result = mapper.valueToTree(obj);
return ok(result);
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,27 @@ public void deletePet(Long petId, String apiKey) throws Exception {
}

@Override
public List<Pet> findPetsByStatus( @NotNull List<String> status) throws Exception {
public CompletionStage<List<Pet>> findPetsByStatus( @NotNull List<String> status) throws Exception {
//Do your magic!!!
return new ArrayList<Pet>();
return CompletableFuture.supplyAsync(() -> {
return new ArrayList<Pet>();
});
}

@Override
public List<Pet> findPetsByTags( @NotNull List<String> tags) throws Exception {
public CompletionStage<List<Pet>> findPetsByTags( @NotNull List<String> tags) throws Exception {
//Do your magic!!!
return new ArrayList<Pet>();
return CompletableFuture.supplyAsync(() -> {
return new ArrayList<Pet>();
});
}

@Override
public Pet getPetById(Long petId) throws Exception {
public CompletionStage<Pet> getPetById(Long petId) throws Exception {
//Do your magic!!!
return new Pet();
return CompletableFuture.supplyAsync(() -> {
return new Pet();
});
}

@Override
Expand All @@ -51,9 +57,11 @@ public void updatePetWithForm(Long petId, String name, String status) throws Exc
}

@Override
public ModelApiResponse uploadFile(Long petId, String additionalMetadata, Http.MultipartFormData.FilePart file) throws Exception {
public CompletionStage<ModelApiResponse> uploadFile(Long petId, String additionalMetadata, Http.MultipartFormData.FilePart file) throws Exception {
//Do your magic!!!
return new ModelApiResponse();
return CompletableFuture.supplyAsync(() -> {
return new ModelApiResponse();
});
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
import java.util.List;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.concurrent.CompletionStage;
import java.util.concurrent.CompletableFuture;

import javax.validation.constraints.*;

Expand All @@ -17,16 +19,16 @@ public interface PetApiControllerImpInterface {

void deletePet(Long petId, String apiKey) throws Exception;

List<Pet> findPetsByStatus( @NotNull List<String> status) throws Exception;
CompletionStage<List<Pet>> findPetsByStatus( @NotNull List<String> status) throws Exception;

List<Pet> findPetsByTags( @NotNull List<String> tags) throws Exception;
CompletionStage<List<Pet>> findPetsByTags( @NotNull List<String> tags) throws Exception;

Pet getPetById(Long petId) throws Exception;
CompletionStage<Pet> getPetById(Long petId) throws Exception;

void updatePet(Pet body) throws Exception;

void updatePetWithForm(Long petId, String name, String status) throws Exception;

ModelApiResponse uploadFile(Long petId, String additionalMetadata, Http.MultipartFormData.FilePart file) throws Exception;
CompletionStage<ModelApiResponse> uploadFile(Long petId, String additionalMetadata, Http.MultipartFormData.FilePart file) throws Exception;

}
Loading