Skip to content

Commit

Permalink
Merge pull request serverlessworkflow#928 from matthias-pichler-warri…
Browse files Browse the repository at this point in the history
…fy/schema-extra-props

Restrict extra props
  • Loading branch information
cdavernas authored Aug 4, 2024
2 parents 333c83c + 2ac77b4 commit 04cd3be
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 13 deletions.
6 changes: 3 additions & 3 deletions dsl-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -555,8 +555,8 @@ do:
one:
with:
type: com.fake.petclinic.pets.checkup.completed.v2
output:
as: '.pets + [{ "id": $pet.id }]'
output:
as: '.pets + [{ "id": $pet.id }]'
```

#### Fork
Expand Down Expand Up @@ -1113,7 +1113,7 @@ document:
use:
secrets:
- usernamePasswordSecret
authentication:
authentications:
sampleBasicFromSecret:
basic:
use: usernamePasswordSecret
Expand Down
6 changes: 2 additions & 4 deletions examples/accumulate-room-readings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,14 @@ do:
correlate:
roomId:
from: .roomid
output:
as: .data.reading
- with:
source: https://my.home.com/sensor
type: my.home.sensors.humidity
correlate:
roomId:
from: .roomid
output:
as: .data.reading
output:
as: .data.reading
- logReading:
for:
each: reading
Expand Down
50 changes: 44 additions & 6 deletions schema/workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ required: [ document, do ]
properties:
document:
type: object
unevaluatedProperties: false
properties:
dsl:
type: string
Expand Down Expand Up @@ -40,6 +41,7 @@ properties:
description: Configures the workflow's input.
use:
type: object
unevaluatedProperties: false
properties:
authentications:
type: object
Expand Down Expand Up @@ -88,6 +90,7 @@ properties:
description: Configures the workflow's output.
schedule:
type: object
unevaluatedProperties: false
properties:
every:
$ref: '#/$defs/duration'
Expand Down Expand Up @@ -186,7 +189,7 @@ $defs:
$ref: '#/$defs/referenceableAuthenticationPolicy'
description: The authentication policy, if any, to use when calling the AsyncAPI operation.
required: [ document, operationRef ]
additionalProperties: false
unevaluatedProperties: false
description: Defines the AsyncAPI call to perform.
- title: CallGRPC
$ref: '#/$defs/taskBase'
Expand All @@ -206,6 +209,7 @@ $defs:
description: The proto resource that describes the GRPC service to call.
service:
type: object
unevaluatedProperties: false
properties:
name:
type: string
Expand All @@ -231,7 +235,7 @@ $defs:
additionalProperties: true
description: The arguments, if any, to call the method with.
required: [ proto, service, method ]
additionalProperties: false
unevaluatedProperties: false
description: Defines the GRPC call to perform.
- title: CallHTTP
$ref: '#/$defs/taskBase'
Expand Down Expand Up @@ -267,7 +271,7 @@ $defs:
enum: [ raw, content, response ]
description: The http call output format. Defaults to 'content'.
required: [ method, endpoint ]
additionalProperties: false
unevaluatedProperties: false
description: Defines the HTTP call to perform.
- title: CallOpenAPI
$ref: '#/$defs/taskBase'
Expand Down Expand Up @@ -300,7 +304,7 @@ $defs:
enum: [ raw, content, response ]
description: The http call output format. Defaults to 'content'.
required: [ document, operationId ]
additionalProperties: false
unevaluatedProperties: false
description: Defines the OpenAPI call to perform.
- title: CallFunction
$ref: '#/$defs/taskBase'
Expand All @@ -327,6 +331,7 @@ $defs:
properties:
fork:
type: object
unevaluatedProperties: false
required: [ branches ]
properties:
branches:
Expand Down Expand Up @@ -355,6 +360,7 @@ $defs:
properties:
emit:
type: object
unevaluatedProperties: false
properties:
event:
type: object
Expand Down Expand Up @@ -402,6 +408,7 @@ $defs:
properties:
for:
type: object
unevaluatedProperties: false
properties:
each:
type: string
Expand Down Expand Up @@ -430,6 +437,7 @@ $defs:
properties:
listen:
type: object
unevaluatedProperties: false
properties:
to:
$ref: '#/$defs/eventConsumptionStrategy'
Expand All @@ -445,6 +453,7 @@ $defs:
properties:
raise:
type: object
unevaluatedProperties: false
properties:
error:
$ref: '#/$defs/error'
Expand All @@ -465,6 +474,7 @@ $defs:
properties:
container:
type: object
unevaluatedProperties: false
properties:
image:
type: string
Expand All @@ -489,6 +499,7 @@ $defs:
properties:
script:
type: object
unevaluatedProperties: false
properties:
language:
type: string
Expand Down Expand Up @@ -518,6 +529,7 @@ $defs:
properties:
shell:
type: object
unevaluatedProperties: false
properties:
command:
type: string
Expand All @@ -540,6 +552,7 @@ $defs:
workflow:
title: RunWorkflowDescriptor
type: object
unevaluatedProperties: false
properties:
namespace:
type: string
Expand Down Expand Up @@ -591,8 +604,8 @@ $defs:
additionalProperties:
type: object
title: SwitchCase
required:
- then
unevaluatedProperties: false
required: [ then ]
properties:
when:
type: string
Expand All @@ -613,6 +626,7 @@ $defs:
$ref: '#/$defs/taskList'
catch:
type: object
unevaluatedProperties: false
properties:
errors:
title: CatchErrors
Expand Down Expand Up @@ -651,6 +665,7 @@ $defs:
- type: string
referenceableAuthenticationPolicy:
type: object
unevaluatedProperties: false
oneOf:
- title: AuthenticationPolicyReference
properties:
Expand All @@ -662,6 +677,7 @@ $defs:
- $ref: '#/$defs/authenticationPolicy'
secretBasedAuthenticationPolicy:
type: object
unevaluatedProperties: false
properties:
use:
type: string
Expand All @@ -675,6 +691,7 @@ $defs:
properties:
basic:
type: object
unevaluatedProperties: false
oneOf:
- title: BasicAuthenticationData
properties:
Expand All @@ -692,6 +709,7 @@ $defs:
properties:
bearer:
type: object
unevaluatedProperties: false
oneOf:
- title: BearerAuthenticationData
properties:
Expand All @@ -706,6 +724,7 @@ $defs:
properties:
oauth2:
type: object
unevaluatedProperties: false
oneOf:
- title: OAuth2AutenthicationData
properties:
Expand All @@ -718,6 +737,7 @@ $defs:
description: The grant type to use.
client:
type: object
unevaluatedProperties: false
properties:
id:
type: string
Expand Down Expand Up @@ -755,6 +775,7 @@ $defs:
description: Defines an authentication policy.
oauth2Token:
type: object
unevaluatedProperties: false
properties:
token:
type: string
Expand All @@ -766,6 +787,7 @@ $defs:
duration:
type: object
minProperties: 1
unevaluatedProperties: false
properties:
days:
type: integer
Expand All @@ -785,6 +807,7 @@ $defs:
description: The definition of a duration.
error:
type: object
unevaluatedProperties: false
properties:
type:
description: A URI reference that identifies the error type.
Expand Down Expand Up @@ -812,6 +835,7 @@ $defs:
required: [ type, status, instance ]
endpoint:
type: object
unevaluatedProperties: false
properties:
uri:
description: The endpoint's URI.
Expand All @@ -826,6 +850,7 @@ $defs:
required: [ uri ]
eventConsumptionStrategy:
type: object
unevaluatedProperties: false
oneOf:
- title: AllEventConsumptionStrategy
properties:
Expand All @@ -851,6 +876,7 @@ $defs:
required: [ one ]
eventFilter:
type: object
unevaluatedProperties: false
properties:
with:
title: WithEvent
Expand Down Expand Up @@ -894,6 +920,7 @@ $defs:
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.
extension:
type: object
unevaluatedProperties: false
properties:
extend:
type: string
Expand All @@ -916,6 +943,7 @@ $defs:
format: uri
- title: ExternalResourceURI
type: object
unevaluatedProperties: false
properties:
uri:
type: string
Expand All @@ -930,6 +958,7 @@ $defs:
required: [ uri ]
input:
type: object
unevaluatedProperties: false
properties:
schema:
$ref: '#/$defs/schema'
Expand All @@ -942,6 +971,7 @@ $defs:
description: Configures the input of a workflow or task.
output:
type: object
unevaluatedProperties: false
properties:
schema:
$ref: '#/$defs/schema'
Expand All @@ -954,6 +984,7 @@ $defs:
description: Configures the output of a workflow or task.
export:
type: object
unevaluatedProperties: false
properties:
schema:
$ref: '#/$defs/schema'
Expand All @@ -966,6 +997,7 @@ $defs:
description: Set the content of the context.
retryPolicy:
type: object
unevaluatedProperties: false
properties:
when:
type: string
Expand All @@ -978,6 +1010,7 @@ $defs:
description: The duration to wait between retry attempts.
backoff:
type: object
unevaluatedProperties: false
oneOf:
- title: ConstantBackoff
properties:
Expand All @@ -1000,9 +1033,11 @@ $defs:
description: The retry duration backoff.
limit:
type: object
unevaluatedProperties: false
properties:
attempt:
type: object
unevaluatedProperties: false
properties:
count:
type: integer
Expand All @@ -1016,6 +1051,7 @@ $defs:
description: The retry limit, if any
jitter:
type: object
unevaluatedProperties: false
properties:
from:
$ref: '#/$defs/duration'
Expand All @@ -1028,6 +1064,7 @@ $defs:
description: Defines a retry policy.
schema:
type: object
unevaluatedProperties: false
properties:
format:
type: string
Expand All @@ -1048,6 +1085,7 @@ $defs:
description: Represents the definition of a schema.
timeout:
type: object
unevaluatedProperties: false
properties:
after:
$ref: '#/$defs/duration'
Expand Down

0 comments on commit 04cd3be

Please sign in to comment.