From deba142d584721fafd5dde7a67c0bab7fd8f7141 Mon Sep 17 00:00:00 2001 From: Ezequiel Valencia Date: Mon, 13 Jan 2025 08:24:51 -0500 Subject: [PATCH] Make the Field Data Ref Object Plural By specifying that the field data references is plural, it helps clarify as to what would be returned from the API. --- python-restclient/docs/FieldDataReference.md | 2 +- .../models/field_data_reference.py | 14 +++--- tools/openapi.yaml | 2 +- .../field/FieldDataDBOperationResults.java | 2 +- .../handlers/FieldData/FieldDataResource.java | 2 +- vcell-restclient/.openapi-generator/FILES | 37 -------------- vcell-restclient/api/openapi.yaml | 4 +- vcell-restclient/docs/FieldDataReference.md | 2 +- .../restclient/model/FieldDataReference.java | 50 +++++++++---------- .../openapi/model/field-data-reference.ts | 2 +- 10 files changed, 40 insertions(+), 77 deletions(-) diff --git a/python-restclient/docs/FieldDataReference.md b/python-restclient/docs/FieldDataReference.md index defad764b4..7643b4772a 100644 --- a/python-restclient/docs/FieldDataReference.md +++ b/python-restclient/docs/FieldDataReference.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **external_data_identifier** | [**ExternalDataIdentifier**](ExternalDataIdentifier.md) | | [optional] **external_data_annotation** | **str** | | [optional] -**external_data_id_sim_ref** | [**List[KeyValue]**](KeyValue.md) | | [optional] +**external_data_id_sim_refs** | [**List[KeyValue]**](KeyValue.md) | | [optional] ## Example diff --git a/python-restclient/vcell_client/models/field_data_reference.py b/python-restclient/vcell_client/models/field_data_reference.py index e2baf64494..670cdc43b0 100644 --- a/python-restclient/vcell_client/models/field_data_reference.py +++ b/python-restclient/vcell_client/models/field_data_reference.py @@ -35,8 +35,8 @@ class FieldDataReference(BaseModel): """ # noqa: E501 external_data_identifier: Optional[ExternalDataIdentifier] = Field(default=None, alias="externalDataIdentifier") external_data_annotation: Optional[StrictStr] = Field(default=None, alias="externalDataAnnotation") - external_data_id_sim_ref: Optional[List[KeyValue]] = Field(default=None, alias="externalDataIDSimRef") - __properties: ClassVar[List[str]] = ["externalDataIdentifier", "externalDataAnnotation", "externalDataIDSimRef"] + external_data_id_sim_refs: Optional[List[KeyValue]] = Field(default=None, alias="externalDataIDSimRefs") + __properties: ClassVar[List[str]] = ["externalDataIdentifier", "externalDataAnnotation", "externalDataIDSimRefs"] model_config = { "populate_by_name": True, @@ -77,13 +77,13 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of external_data_identifier if self.external_data_identifier: _dict['externalDataIdentifier'] = self.external_data_identifier.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in external_data_id_sim_ref (list) + # override the default output from pydantic by calling `to_dict()` of each item in external_data_id_sim_refs (list) _items = [] - if self.external_data_id_sim_ref: - for _item in self.external_data_id_sim_ref: + if self.external_data_id_sim_refs: + for _item in self.external_data_id_sim_refs: if _item: _items.append(_item.to_dict()) - _dict['externalDataIDSimRef'] = _items + _dict['externalDataIDSimRefs'] = _items return _dict @classmethod @@ -103,7 +103,7 @@ def from_dict(cls, obj: Dict) -> Self: _obj = cls.model_validate({ "externalDataIdentifier": ExternalDataIdentifier.from_dict(obj.get("externalDataIdentifier")) if obj.get("externalDataIdentifier") is not None else None, "externalDataAnnotation": obj.get("externalDataAnnotation"), - "externalDataIDSimRef": [KeyValue.from_dict(_item) for _item in obj.get("externalDataIDSimRef")] if obj.get("externalDataIDSimRef") is not None else None + "externalDataIDSimRefs": [KeyValue.from_dict(_item) for _item in obj.get("externalDataIDSimRefs")] if obj.get("externalDataIDSimRefs") is not None else None }) return _obj diff --git a/tools/openapi.yaml b/tools/openapi.yaml index 75263ca38b..8dc97abffb 100644 --- a/tools/openapi.yaml +++ b/tools/openapi.yaml @@ -806,7 +806,7 @@ components: $ref: '#/components/schemas/ExternalDataIdentifier' externalDataAnnotation: type: string - externalDataIDSimRef: + externalDataIDSimRefs: type: array items: $ref: '#/components/schemas/KeyValue' diff --git a/vcell-core/src/main/java/cbit/vcell/field/FieldDataDBOperationResults.java b/vcell-core/src/main/java/cbit/vcell/field/FieldDataDBOperationResults.java index 22e11a9a3a..160969ee49 100644 --- a/vcell-core/src/main/java/cbit/vcell/field/FieldDataDBOperationResults.java +++ b/vcell-core/src/main/java/cbit/vcell/field/FieldDataDBOperationResults.java @@ -39,7 +39,7 @@ public static FieldDataDBOperationResults fieldDataReferencesToDBResults(List keyValues = fieldDataReference.getExternalDataIDSimRef().stream().map(KeyValue::dtoToKeyValue).collect(Collectors.toList()); + List keyValues = fieldDataReference.getExternalDataIDSimRefs().stream().map(KeyValue::dtoToKeyValue).collect(Collectors.toList()); externalDataIDSimRefs.put(externalDataIdentifier, new Vector<>(keyValues)); } fieldDataDBOperationResults.extDataIDArr = externalDataIdentifiers.toArray(new ExternalDataIdentifier[0]); diff --git a/vcell-rest/src/main/java/org/vcell/restq/handlers/FieldData/FieldDataResource.java b/vcell-rest/src/main/java/org/vcell/restq/handlers/FieldData/FieldDataResource.java index ae4c57f207..2011222286 100644 --- a/vcell-rest/src/main/java/org/vcell/restq/handlers/FieldData/FieldDataResource.java +++ b/vcell-rest/src/main/java/org/vcell/restq/handlers/FieldData/FieldDataResource.java @@ -175,7 +175,7 @@ public record FieldDataShape( public record FieldDataReference( ExternalDataIdentifier externalDataIdentifier, String externalDataAnnotation, - Vector externalDataIDSimRef + Vector externalDataIDSimRefs ) { } public record AnalyzedResultsFromFieldData( diff --git a/vcell-restclient/.openapi-generator/FILES b/vcell-restclient/.openapi-generator/FILES index 42670fc967..2a54d3a046 100644 --- a/vcell-restclient/.openapi-generator/FILES +++ b/vcell-restclient/.openapi-generator/FILES @@ -100,40 +100,3 @@ src/main/java/org/vcell/restclient/model/UserRegistrationInfo.java src/main/java/org/vcell/restclient/model/VCSimulationIdentifier.java src/main/java/org/vcell/restclient/model/VariableDomain.java src/main/java/org/vcell/restclient/model/VariableType.java -src/test/java/org/vcell/restclient/model/AccesTokenRepresentationRecordTest.java -src/test/java/org/vcell/restclient/model/AnalyzedResultsFromFieldDataTest.java -src/test/java/org/vcell/restclient/model/BatchSystemTypeTest.java -src/test/java/org/vcell/restclient/model/BioModelTest.java -src/test/java/org/vcell/restclient/model/BiomodelRefTest.java -src/test/java/org/vcell/restclient/model/DataIdentifierTest.java -src/test/java/org/vcell/restclient/model/DetailedStateTest.java -src/test/java/org/vcell/restclient/model/DomainTest.java -src/test/java/org/vcell/restclient/model/ExtentTest.java -src/test/java/org/vcell/restclient/model/ExternalDataIdentifierTest.java -src/test/java/org/vcell/restclient/model/FieldDataReferenceTest.java -src/test/java/org/vcell/restclient/model/FieldDataSaveResultsTest.java -src/test/java/org/vcell/restclient/model/FieldDataShapeTest.java -src/test/java/org/vcell/restclient/model/HelloWorldMessageTest.java -src/test/java/org/vcell/restclient/model/HtcJobIDTest.java -src/test/java/org/vcell/restclient/model/ISizeTest.java -src/test/java/org/vcell/restclient/model/IdentityTest.java -src/test/java/org/vcell/restclient/model/KeyValueTest.java -src/test/java/org/vcell/restclient/model/MathmodelRefTest.java -src/test/java/org/vcell/restclient/model/OriginTest.java -src/test/java/org/vcell/restclient/model/PublicationTest.java -src/test/java/org/vcell/restclient/model/SchedulerStatusTest.java -src/test/java/org/vcell/restclient/model/SimulationExecutionStatusRecordTest.java -src/test/java/org/vcell/restclient/model/SimulationJobStatusRecordTest.java -src/test/java/org/vcell/restclient/model/SimulationMessageTest.java -src/test/java/org/vcell/restclient/model/SimulationQueueEntryStatusRecordTest.java -src/test/java/org/vcell/restclient/model/SimulationQueueIDTest.java -src/test/java/org/vcell/restclient/model/SimulationStatusPersistentRecordTest.java -src/test/java/org/vcell/restclient/model/StatusMessageTest.java -src/test/java/org/vcell/restclient/model/StatusTest.java -src/test/java/org/vcell/restclient/model/UserIdentityJSONSafeTest.java -src/test/java/org/vcell/restclient/model/UserLoginInfoForMappingTest.java -src/test/java/org/vcell/restclient/model/UserRegistrationInfoTest.java -src/test/java/org/vcell/restclient/model/UserTest.java -src/test/java/org/vcell/restclient/model/VCSimulationIdentifierTest.java -src/test/java/org/vcell/restclient/model/VariableDomainTest.java -src/test/java/org/vcell/restclient/model/VariableTypeTest.java diff --git a/vcell-restclient/api/openapi.yaml b/vcell-restclient/api/openapi.yaml index 37be006158..f75ef73ca8 100644 --- a/vcell-restclient/api/openapi.yaml +++ b/vcell-restclient/api/openapi.yaml @@ -985,7 +985,7 @@ components: key: value: 0.8008281904610115 parameterScanType: true - externalDataIDSimRef: + externalDataIDSimRefs: - value: 0.8008281904610115 - value: 0.8008281904610115 properties: @@ -993,7 +993,7 @@ components: $ref: '#/components/schemas/ExternalDataIdentifier' externalDataAnnotation: type: string - externalDataIDSimRef: + externalDataIDSimRefs: items: $ref: '#/components/schemas/KeyValue' type: array diff --git a/vcell-restclient/docs/FieldDataReference.md b/vcell-restclient/docs/FieldDataReference.md index e836868f6b..a7a3662c95 100644 --- a/vcell-restclient/docs/FieldDataReference.md +++ b/vcell-restclient/docs/FieldDataReference.md @@ -9,7 +9,7 @@ |------------ | ------------- | ------------- | -------------| |**externalDataIdentifier** | [**ExternalDataIdentifier**](ExternalDataIdentifier.md) | | [optional] | |**externalDataAnnotation** | **String** | | [optional] | -|**externalDataIDSimRef** | [**List<KeyValue>**](KeyValue.md) | | [optional] | +|**externalDataIDSimRefs** | [**List<KeyValue>**](KeyValue.md) | | [optional] | diff --git a/vcell-restclient/src/main/java/org/vcell/restclient/model/FieldDataReference.java b/vcell-restclient/src/main/java/org/vcell/restclient/model/FieldDataReference.java index 930d4275dd..4c2ee8f0e7 100644 --- a/vcell-restclient/src/main/java/org/vcell/restclient/model/FieldDataReference.java +++ b/vcell-restclient/src/main/java/org/vcell/restclient/model/FieldDataReference.java @@ -38,7 +38,7 @@ @JsonPropertyOrder({ FieldDataReference.JSON_PROPERTY_EXTERNAL_DATA_IDENTIFIER, FieldDataReference.JSON_PROPERTY_EXTERNAL_DATA_ANNOTATION, - FieldDataReference.JSON_PROPERTY_EXTERNAL_DATA_I_D_SIM_REF + FieldDataReference.JSON_PROPERTY_EXTERNAL_DATA_I_D_SIM_REFS }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class FieldDataReference { @@ -48,8 +48,8 @@ public class FieldDataReference { public static final String JSON_PROPERTY_EXTERNAL_DATA_ANNOTATION = "externalDataAnnotation"; private String externalDataAnnotation; - public static final String JSON_PROPERTY_EXTERNAL_DATA_I_D_SIM_REF = "externalDataIDSimRef"; - private List externalDataIDSimRef; + public static final String JSON_PROPERTY_EXTERNAL_DATA_I_D_SIM_REFS = "externalDataIDSimRefs"; + private List externalDataIDSimRefs; public FieldDataReference() { } @@ -104,36 +104,36 @@ public void setExternalDataAnnotation(String externalDataAnnotation) { } - public FieldDataReference externalDataIDSimRef(List externalDataIDSimRef) { - this.externalDataIDSimRef = externalDataIDSimRef; + public FieldDataReference externalDataIDSimRefs(List externalDataIDSimRefs) { + this.externalDataIDSimRefs = externalDataIDSimRefs; return this; } - public FieldDataReference addExternalDataIDSimRefItem(KeyValue externalDataIDSimRefItem) { - if (this.externalDataIDSimRef == null) { - this.externalDataIDSimRef = new ArrayList<>(); + public FieldDataReference addExternalDataIDSimRefsItem(KeyValue externalDataIDSimRefsItem) { + if (this.externalDataIDSimRefs == null) { + this.externalDataIDSimRefs = new ArrayList<>(); } - this.externalDataIDSimRef.add(externalDataIDSimRefItem); + this.externalDataIDSimRefs.add(externalDataIDSimRefsItem); return this; } /** - * Get externalDataIDSimRef - * @return externalDataIDSimRef + * Get externalDataIDSimRefs + * @return externalDataIDSimRefs **/ @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_EXTERNAL_DATA_I_D_SIM_REF) + @JsonProperty(JSON_PROPERTY_EXTERNAL_DATA_I_D_SIM_REFS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getExternalDataIDSimRef() { - return externalDataIDSimRef; + public List getExternalDataIDSimRefs() { + return externalDataIDSimRefs; } - @JsonProperty(JSON_PROPERTY_EXTERNAL_DATA_I_D_SIM_REF) + @JsonProperty(JSON_PROPERTY_EXTERNAL_DATA_I_D_SIM_REFS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setExternalDataIDSimRef(List externalDataIDSimRef) { - this.externalDataIDSimRef = externalDataIDSimRef; + public void setExternalDataIDSimRefs(List externalDataIDSimRefs) { + this.externalDataIDSimRefs = externalDataIDSimRefs; } @@ -151,12 +151,12 @@ public boolean equals(Object o) { FieldDataReference fieldDataReference = (FieldDataReference) o; return Objects.equals(this.externalDataIdentifier, fieldDataReference.externalDataIdentifier) && Objects.equals(this.externalDataAnnotation, fieldDataReference.externalDataAnnotation) && - Objects.equals(this.externalDataIDSimRef, fieldDataReference.externalDataIDSimRef); + Objects.equals(this.externalDataIDSimRefs, fieldDataReference.externalDataIDSimRefs); } @Override public int hashCode() { - return Objects.hash(externalDataIdentifier, externalDataAnnotation, externalDataIDSimRef); + return Objects.hash(externalDataIdentifier, externalDataAnnotation, externalDataIDSimRefs); } @Override @@ -165,7 +165,7 @@ public String toString() { sb.append("class FieldDataReference {\n"); sb.append(" externalDataIdentifier: ").append(toIndentedString(externalDataIdentifier)).append("\n"); sb.append(" externalDataAnnotation: ").append(toIndentedString(externalDataAnnotation)).append("\n"); - sb.append(" externalDataIDSimRef: ").append(toIndentedString(externalDataIDSimRef)).append("\n"); + sb.append(" externalDataIDSimRefs: ").append(toIndentedString(externalDataIDSimRefs)).append("\n"); sb.append("}"); return sb.toString(); } @@ -223,11 +223,11 @@ public String toUrlQueryString(String prefix) { joiner.add(String.format("%sexternalDataAnnotation%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getExternalDataAnnotation()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } - // add `externalDataIDSimRef` to the URL query string - if (getExternalDataIDSimRef() != null) { - for (int i = 0; i < getExternalDataIDSimRef().size(); i++) { - if (getExternalDataIDSimRef().get(i) != null) { - joiner.add(getExternalDataIDSimRef().get(i).toUrlQueryString(String.format("%sexternalDataIDSimRef%s%s", prefix, suffix, + // add `externalDataIDSimRefs` to the URL query string + if (getExternalDataIDSimRefs() != null) { + for (int i = 0; i < getExternalDataIDSimRefs().size(); i++) { + if (getExternalDataIDSimRefs().get(i) != null) { + joiner.add(getExternalDataIDSimRefs().get(i).toUrlQueryString(String.format("%sexternalDataIDSimRefs%s%s", prefix, suffix, "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); } } diff --git a/webapp-ng/src/app/core/modules/openapi/model/field-data-reference.ts b/webapp-ng/src/app/core/modules/openapi/model/field-data-reference.ts index a761f15713..61aa0cd6c6 100644 --- a/webapp-ng/src/app/core/modules/openapi/model/field-data-reference.ts +++ b/webapp-ng/src/app/core/modules/openapi/model/field-data-reference.ts @@ -16,6 +16,6 @@ import { ExternalDataIdentifier } from './external-data-identifier'; export interface FieldDataReference { externalDataIdentifier?: ExternalDataIdentifier; externalDataAnnotation?: string; - externalDataIDSimRef?: Array; + externalDataIDSimRefs?: Array; }