serverlessworkflow / sdk-typescript

Typescript SDK for Serverless Workflow
https://serverlessworkflow.io/
Apache License 2.0
64 stars 16 forks source link

Properties are not serialized in "order" #130

Closed antmendoza closed 2 years ago

antmendoza commented 3 years ago

What would you like to be added: Would be nice to have a way to define the order in witch are serialized the properties.

For example, for eventstate, type and exclusive properties are always printed in first place:

    "states": [
        {
          "type": "event",
          "exclusive": true,
          "name": "StoreCarAuctionBid",
          "onEvents": [
.....    
]

Instead should be:

    "states": [
        {
          "name": "StoreCarAuctionBid",
          "type": "event",
          "exclusive": true,
          "onEvents": [
.....    
]

Why is this needed:

tsurdilo commented 3 years ago

@antmendoza yeah for states please make id(if defined), name ,and type the first three params no matter which state it is

tsurdilo commented 3 years ago

@antmendoza also we should define the order of top level properties across all sdks.

some rules that could be applied now:

tsurdilo commented 3 years ago

@antmendoza also for things like function definitions, on output we should group them by type, same for events (kinda - produced/consumed). this can be applied to many other definitions (in reusable defs)