serverlessworkflow / sdk-java

Java SDK for Serverless Workflow
http://serverlessworkflow.io
Apache License 2.0
79 stars 46 forks source link

Failing to recognize format property for schema #461

Closed fjtirado closed 1 week ago

fjtirado commented 2 weeks ago

What happened: Following definition

document:
  dsl: 1.0.0-alpha2
  namespace: examples
  name: http-query-params
  version: 1.0.0-alpha2
input:
  schema:
    format: json
    document:
      type: object
      required:
        - searchQuery
      properties:
        searchQuery:
          type: string
do:
  - searchStarWarsCharacters:
      call: http
      with:
        method: get
        endpoint: https://swapi.dev/api/people/
        query:
          search: ${.searchQuery}

fails to deserializer with exception

com.fasterxml.jackson.databind.JsonMappingException: 
Problem deserializing class io.serverlessworkflow.api.types.Schema
 at [Source: (BufferedInputStream); line: 16, column: 1] (through reference chain: io.serverlessworkflow.api.types.Workflow["input"]->io.serverlessworkflow.api.types.Input["schema"])
......
Suppressed: com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "format" (class io.serverlessworkflow.api.types.SchemaInline), not marked as ignorable (one known property: "document"])
 at [Source: UNKNOWN; byte offset: #UNKNOWN] (through reference chain: io.serverlessworkflow.api.types.SchemaInline["format"])
        at com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException.from(UnrecognizedPropertyException.java:61)
        at com.fasterxml.jackson.databind.DeserializationContext.handleUnknownProperty(DeserializationContext.java:1153)
        at com.fasterxml.jackson.databind.deser.std.StdDeserializer.handleUnknownProperty(StdDeserializer.java:2241)
        at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.handleUnknownProperty(BeanDeserializerBase.java:1821)
        at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.handleUnknownVanilla(BeanDeserializerBase.java:1799)
        at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:316)
        at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:177)
        at io.serverlessworkflow.serialization.BeanDeserializerWithValidation.deserialize(BeanDeserializerWithValidation.java:47)
        at com.fasterxml.jackson.databind.deser.DefaultDeserializationContext.readRootValue(DefaultDeserializationContext.java:342)
        at com.fasterxml.jackson.databind.ObjectMapper._readValue(ObjectMapper.java:4893)
        at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3036)
        at com.fasterxml.jackson.databind.ObjectMapper.treeToValue(ObjectMapper.java:3500)
        at io.serverlessworkflow.serialization.DeserializeHelper.deserializeOneOf(DeserializeHelper.java:35)
        ... 69 more
    Suppressed: com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "format" (class io.serverlessworkflow.api.types.SchemaExternal), not marked as ignorable (one known property: "resource"])
 at [Source: UNKNOWN; byte offset: #UNKNOWN] (through reference chain: io.serverlessworkflow.api.types.SchemaExternal["format"])

What you expected to happen:

How to reproduce it:

Anything else we need to know?: As a workaroung, format can be removed.

Environment: