Skip to content

Commit 04cd3be

Browse files
authored
Merge pull request serverlessworkflow#928 from matthias-pichler-warrify/schema-extra-props
Restrict extra props
2 parents 333c83c + 2ac77b4 commit 04cd3be

File tree

3 files changed

+49
-13
lines changed

3 files changed

+49
-13
lines changed

dsl-reference.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -555,8 +555,8 @@ do:
555555
one:
556556
with:
557557
type: com.fake.petclinic.pets.checkup.completed.v2
558-
output:
559-
as: '.pets + [{ "id": $pet.id }]'
558+
output:
559+
as: '.pets + [{ "id": $pet.id }]'
560560
```
561561

562562
#### Fork
@@ -1113,7 +1113,7 @@ document:
11131113
use:
11141114
secrets:
11151115
- usernamePasswordSecret
1116-
authentication:
1116+
authentications:
11171117
sampleBasicFromSecret:
11181118
basic:
11191119
use: usernamePasswordSecret

examples/accumulate-room-readings.yaml

+2-4
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,14 @@ do:
1414
correlate:
1515
roomId:
1616
from: .roomid
17-
output:
18-
as: .data.reading
1917
- with:
2018
source: https://my.home.com/sensor
2119
type: my.home.sensors.humidity
2220
correlate:
2321
roomId:
2422
from: .roomid
25-
output:
26-
as: .data.reading
23+
output:
24+
as: .data.reading
2725
- logReading:
2826
for:
2927
each: reading

schema/workflow.yaml

+44-6
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ required: [ document, do ]
66
properties:
77
document:
88
type: object
9+
unevaluatedProperties: false
910
properties:
1011
dsl:
1112
type: string
@@ -40,6 +41,7 @@ properties:
4041
description: Configures the workflow's input.
4142
use:
4243
type: object
44+
unevaluatedProperties: false
4345
properties:
4446
authentications:
4547
type: object
@@ -88,6 +90,7 @@ properties:
8890
description: Configures the workflow's output.
8991
schedule:
9092
type: object
93+
unevaluatedProperties: false
9194
properties:
9295
every:
9396
$ref: '#/$defs/duration'
@@ -186,7 +189,7 @@ $defs:
186189
$ref: '#/$defs/referenceableAuthenticationPolicy'
187190
description: The authentication policy, if any, to use when calling the AsyncAPI operation.
188191
required: [ document, operationRef ]
189-
additionalProperties: false
192+
unevaluatedProperties: false
190193
description: Defines the AsyncAPI call to perform.
191194
- title: CallGRPC
192195
$ref: '#/$defs/taskBase'
@@ -206,6 +209,7 @@ $defs:
206209
description: The proto resource that describes the GRPC service to call.
207210
service:
208211
type: object
212+
unevaluatedProperties: false
209213
properties:
210214
name:
211215
type: string
@@ -231,7 +235,7 @@ $defs:
231235
additionalProperties: true
232236
description: The arguments, if any, to call the method with.
233237
required: [ proto, service, method ]
234-
additionalProperties: false
238+
unevaluatedProperties: false
235239
description: Defines the GRPC call to perform.
236240
- title: CallHTTP
237241
$ref: '#/$defs/taskBase'
@@ -267,7 +271,7 @@ $defs:
267271
enum: [ raw, content, response ]
268272
description: The http call output format. Defaults to 'content'.
269273
required: [ method, endpoint ]
270-
additionalProperties: false
274+
unevaluatedProperties: false
271275
description: Defines the HTTP call to perform.
272276
- title: CallOpenAPI
273277
$ref: '#/$defs/taskBase'
@@ -300,7 +304,7 @@ $defs:
300304
enum: [ raw, content, response ]
301305
description: The http call output format. Defaults to 'content'.
302306
required: [ document, operationId ]
303-
additionalProperties: false
307+
unevaluatedProperties: false
304308
description: Defines the OpenAPI call to perform.
305309
- title: CallFunction
306310
$ref: '#/$defs/taskBase'
@@ -327,6 +331,7 @@ $defs:
327331
properties:
328332
fork:
329333
type: object
334+
unevaluatedProperties: false
330335
required: [ branches ]
331336
properties:
332337
branches:
@@ -355,6 +360,7 @@ $defs:
355360
properties:
356361
emit:
357362
type: object
363+
unevaluatedProperties: false
358364
properties:
359365
event:
360366
type: object
@@ -402,6 +408,7 @@ $defs:
402408
properties:
403409
for:
404410
type: object
411+
unevaluatedProperties: false
405412
properties:
406413
each:
407414
type: string
@@ -430,6 +437,7 @@ $defs:
430437
properties:
431438
listen:
432439
type: object
440+
unevaluatedProperties: false
433441
properties:
434442
to:
435443
$ref: '#/$defs/eventConsumptionStrategy'
@@ -445,6 +453,7 @@ $defs:
445453
properties:
446454
raise:
447455
type: object
456+
unevaluatedProperties: false
448457
properties:
449458
error:
450459
$ref: '#/$defs/error'
@@ -465,6 +474,7 @@ $defs:
465474
properties:
466475
container:
467476
type: object
477+
unevaluatedProperties: false
468478
properties:
469479
image:
470480
type: string
@@ -489,6 +499,7 @@ $defs:
489499
properties:
490500
script:
491501
type: object
502+
unevaluatedProperties: false
492503
properties:
493504
language:
494505
type: string
@@ -518,6 +529,7 @@ $defs:
518529
properties:
519530
shell:
520531
type: object
532+
unevaluatedProperties: false
521533
properties:
522534
command:
523535
type: string
@@ -540,6 +552,7 @@ $defs:
540552
workflow:
541553
title: RunWorkflowDescriptor
542554
type: object
555+
unevaluatedProperties: false
543556
properties:
544557
namespace:
545558
type: string
@@ -591,8 +604,8 @@ $defs:
591604
additionalProperties:
592605
type: object
593606
title: SwitchCase
594-
required:
595-
- then
607+
unevaluatedProperties: false
608+
required: [ then ]
596609
properties:
597610
when:
598611
type: string
@@ -613,6 +626,7 @@ $defs:
613626
$ref: '#/$defs/taskList'
614627
catch:
615628
type: object
629+
unevaluatedProperties: false
616630
properties:
617631
errors:
618632
title: CatchErrors
@@ -651,6 +665,7 @@ $defs:
651665
- type: string
652666
referenceableAuthenticationPolicy:
653667
type: object
668+
unevaluatedProperties: false
654669
oneOf:
655670
- title: AuthenticationPolicyReference
656671
properties:
@@ -662,6 +677,7 @@ $defs:
662677
- $ref: '#/$defs/authenticationPolicy'
663678
secretBasedAuthenticationPolicy:
664679
type: object
680+
unevaluatedProperties: false
665681
properties:
666682
use:
667683
type: string
@@ -675,6 +691,7 @@ $defs:
675691
properties:
676692
basic:
677693
type: object
694+
unevaluatedProperties: false
678695
oneOf:
679696
- title: BasicAuthenticationData
680697
properties:
@@ -692,6 +709,7 @@ $defs:
692709
properties:
693710
bearer:
694711
type: object
712+
unevaluatedProperties: false
695713
oneOf:
696714
- title: BearerAuthenticationData
697715
properties:
@@ -706,6 +724,7 @@ $defs:
706724
properties:
707725
oauth2:
708726
type: object
727+
unevaluatedProperties: false
709728
oneOf:
710729
- title: OAuth2AutenthicationData
711730
properties:
@@ -718,6 +737,7 @@ $defs:
718737
description: The grant type to use.
719738
client:
720739
type: object
740+
unevaluatedProperties: false
721741
properties:
722742
id:
723743
type: string
@@ -755,6 +775,7 @@ $defs:
755775
description: Defines an authentication policy.
756776
oauth2Token:
757777
type: object
778+
unevaluatedProperties: false
758779
properties:
759780
token:
760781
type: string
@@ -766,6 +787,7 @@ $defs:
766787
duration:
767788
type: object
768789
minProperties: 1
790+
unevaluatedProperties: false
769791
properties:
770792
days:
771793
type: integer
@@ -785,6 +807,7 @@ $defs:
785807
description: The definition of a duration.
786808
error:
787809
type: object
810+
unevaluatedProperties: false
788811
properties:
789812
type:
790813
description: A URI reference that identifies the error type.
@@ -812,6 +835,7 @@ $defs:
812835
required: [ type, status, instance ]
813836
endpoint:
814837
type: object
838+
unevaluatedProperties: false
815839
properties:
816840
uri:
817841
description: The endpoint's URI.
@@ -826,6 +850,7 @@ $defs:
826850
required: [ uri ]
827851
eventConsumptionStrategy:
828852
type: object
853+
unevaluatedProperties: false
829854
oneOf:
830855
- title: AllEventConsumptionStrategy
831856
properties:
@@ -851,6 +876,7 @@ $defs:
851876
required: [ one ]
852877
eventFilter:
853878
type: object
879+
unevaluatedProperties: false
854880
properties:
855881
with:
856882
title: WithEvent
@@ -894,6 +920,7 @@ $defs:
894920
description: An event filter is a mechanism used to selectively process or handle events based on predefined criteria, such as event type, source, or specific attributes.
895921
extension:
896922
type: object
923+
unevaluatedProperties: false
897924
properties:
898925
extend:
899926
type: string
@@ -916,6 +943,7 @@ $defs:
916943
format: uri
917944
- title: ExternalResourceURI
918945
type: object
946+
unevaluatedProperties: false
919947
properties:
920948
uri:
921949
type: string
@@ -930,6 +958,7 @@ $defs:
930958
required: [ uri ]
931959
input:
932960
type: object
961+
unevaluatedProperties: false
933962
properties:
934963
schema:
935964
$ref: '#/$defs/schema'
@@ -942,6 +971,7 @@ $defs:
942971
description: Configures the input of a workflow or task.
943972
output:
944973
type: object
974+
unevaluatedProperties: false
945975
properties:
946976
schema:
947977
$ref: '#/$defs/schema'
@@ -954,6 +984,7 @@ $defs:
954984
description: Configures the output of a workflow or task.
955985
export:
956986
type: object
987+
unevaluatedProperties: false
957988
properties:
958989
schema:
959990
$ref: '#/$defs/schema'
@@ -966,6 +997,7 @@ $defs:
966997
description: Set the content of the context.
967998
retryPolicy:
968999
type: object
1000+
unevaluatedProperties: false
9691001
properties:
9701002
when:
9711003
type: string
@@ -978,6 +1010,7 @@ $defs:
9781010
description: The duration to wait between retry attempts.
9791011
backoff:
9801012
type: object
1013+
unevaluatedProperties: false
9811014
oneOf:
9821015
- title: ConstantBackoff
9831016
properties:
@@ -1000,9 +1033,11 @@ $defs:
10001033
description: The retry duration backoff.
10011034
limit:
10021035
type: object
1036+
unevaluatedProperties: false
10031037
properties:
10041038
attempt:
10051039
type: object
1040+
unevaluatedProperties: false
10061041
properties:
10071042
count:
10081043
type: integer
@@ -1016,6 +1051,7 @@ $defs:
10161051
description: The retry limit, if any
10171052
jitter:
10181053
type: object
1054+
unevaluatedProperties: false
10191055
properties:
10201056
from:
10211057
$ref: '#/$defs/duration'
@@ -1028,6 +1064,7 @@ $defs:
10281064
description: Defines a retry policy.
10291065
schema:
10301066
type: object
1067+
unevaluatedProperties: false
10311068
properties:
10321069
format:
10331070
type: string
@@ -1048,6 +1085,7 @@ $defs:
10481085
description: Represents the definition of a schema.
10491086
timeout:
10501087
type: object
1088+
unevaluatedProperties: false
10511089
properties:
10521090
after:
10531091
$ref: '#/$defs/duration'

0 commit comments

Comments
 (0)