Remove invalid constraints, prepare python generator for deployment
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Armin Friedl 2020-07-13 21:55:02 +02:00
parent bcfbf349cd
commit 0c1fe8efce
Signed by: armin
GPG key ID: 48C726EEE7FBCBC8
7 changed files with 25 additions and 23 deletions

View file

@ -41,8 +41,22 @@ steps:
- openapi-generator generate
-i http://runservice:8080/v3/api-docs
-g python
--additional-properties packageName=flingclient
-o flingclient.py
--enable-post-process-file
- cd flingclient.py
- |+
cat << EOF
[distutils]
index-servers =
nexus
[private-repository]
repository = <private-repository URL>
username = <private-repository username>
password = <private-repository password>
EOF >> .pypirc
- cat .pypirc
- cd ..
# JavaScript client
- openapi-generator generate
-i http://runservice:8080/v3/api-docs

View file

@ -18,7 +18,6 @@ import lombok.NoArgsConstructor;
@Schema(name = "Artifact")
public class ArtifactDto {
@Schema(accessMode = AccessMode.READ_ONLY, type = "string")
@NotNull
private UUID id;
@Schema(type = "string",

View file

@ -17,7 +17,6 @@ import lombok.NoArgsConstructor;
@Schema(name = "Fling")
public class FlingDto {
@Schema(accessMode = AccessMode.READ_ONLY, type = "string")
@NotNull
private UUID id;
@Schema(description = "Name of the fling")
@ -26,7 +25,6 @@ public class FlingDto {
@Schema(type = "integer", format = "int64", accessMode = AccessMode.READ_ONLY,
description = "Creation time in milliseconds since the unix epoch 01.01.1970 00:00:00 UTC")
@NotNull
private Instant creationTime;
@Schema(description = "Share id of the fling. Used in the share link.")

View file

@ -22,7 +22,7 @@ public class ArtifactDtoTest {
private Validator validator;
@Test
void testSetId_null_validationFails() {
void testSetId_null_validationOk() {
ArtifactDto artifactDto = ArtifactDto.builder()
.id(null)
.path(Paths.get("test"))
@ -31,10 +31,7 @@ public class ArtifactDtoTest {
Set<ConstraintViolation<ArtifactDto>> constraintViolations = validator.validate(artifactDto);
assertThat(constraintViolations).hasSize(1);
ConstraintViolation<ArtifactDto> violation = constraintViolations.iterator().next();
assertThat(violation.getPropertyPath().toString()).isEqualTo("id");
assertThat(violation.getMessage()).isEqualTo("must not be null");
assertThat(constraintViolations).hasSize(0);
}
@Test

View file

@ -22,7 +22,7 @@ public class FlingDtoTest {
private Validator validator;
@Test
void testSetId_null_validationFails() {
void testSetId_null_validationOk() {
FlingDto flingDto = FlingDto.builder()
.id(null)
.name("test")
@ -33,10 +33,7 @@ public class FlingDtoTest {
Set<ConstraintViolation<FlingDto>> constraintViolations = validator.validate(flingDto);
assertThat(constraintViolations).hasSize(1);
ConstraintViolation<FlingDto> violation = constraintViolations.iterator().next();
assertThat(violation.getPropertyPath().toString()).isEqualTo("id");
assertThat(violation.getMessage()).isEqualTo("must not be null");
assertThat(constraintViolations).hasSize(0);
}
@Test
@ -58,7 +55,7 @@ public class FlingDtoTest {
}
@Test
void testSetCreationTime_null_validationFails() {
void testSetCreationTime_null_validationOk() {
FlingDto flingDto = FlingDto.builder()
.id(new UUID(0L, 0L))
.name("test")
@ -69,10 +66,7 @@ public class FlingDtoTest {
Set<ConstraintViolation<FlingDto>> constraintViolations = validator.validate(flingDto);
assertThat(constraintViolations).hasSize(1);
ConstraintViolation<FlingDto> violation = constraintViolations.iterator().next();
assertThat(violation.getPropertyPath().toString()).isEqualTo("creationTime");
assertThat(violation.getMessage()).isEqualTo("must not be null");
assertThat(constraintViolations).hasSize(0);
}

View file

@ -1210,7 +1210,7 @@
"@fling/flingclient": {
"version": "0.1.0-snapshot",
"resolved": "https://nexus.friedl.net/repository/npm-private/@fling/flingclient/-/flingclient-0.1.0-snapshot.tgz",
"integrity": "sha512-KXeJE/tTCi+IRBZ8pBeFLFEn7GDBWw/aIDj4xaofjw6S0DFEpw5TwW+Oh45NALk/SEiR4DKBuG/sfgiHrpZwLA==",
"integrity": "sha512-Ws4M0st41sb8gQz07k3ygEXoqx5GtSmH9rr/RzrJhQELt0dVxNi8qJY3VcJxV6svpYvwKDacRyy+aXnNnOG6/w==",
"requires": {
"@babel/cli": "^7.0.0",
"superagent": "3.7.0"

View file

@ -16,16 +16,16 @@ function TileAction(props) {
<ul className="menu text-left">
<li className="menu-item input-group">
<div className="input-group">
<input type="text" ref={shareUrlRef} className="form-input input-sm input-share-id" readOnly value={props.fling.sharing.shareUrl} />
<input type="text" ref={shareUrlRef} className="form-input input-sm input-share-id" readOnly value={props.fling.shareId} />
<span className="input-group-addon addon-sm input-group-addon-sm" onClick={copyShareUrl} ><i className="icon icon-copy" /></span>
</div>
</li>
<li className="menu-item">
<div className="form-group">
<label className="form-switch">
<input type="checkbox" checked={props.fling.sharing.shared} onChange={toggleShared} />
<input type="checkbox" checked={props.fling.shared} onChange={toggleShared} />
<i className="form-icon" />
{props.fling.sharing.shared ? "Shared":"Private"}
{props.fling.shared ? "Shared":"Private"}
</label>
</div>
</li>
@ -57,7 +57,7 @@ function TileAction(props) {
}
async function toggleShared() {
await flingClient.putFling(props.fling.id, {"sharing": {"shared": !props.fling.sharing.shared}});
await flingClient.putFling(props.fling.id, {"sharing": {"shared": !props.fling.shared}});
await props.refreshFlingListFn();
}
}