Json OpenApi 3.0.0 to Tibco BW XSD Invoke activity

134 Views Asked by At

In this XSD file generated by Tibco BW when i drag and drop the post /contexts operation from my project.json from api-docs spring boot SWAGGER in Tibco BW, Tibco generates an XSD and a part is like following:

<xs:element name="JsonSchema" type="tns:JsonSchema"/>
    <xs:complexType name="JsonSchema">
        <xs:sequence>
            <xs:element minOccurs="0" name="title" type="xs:string"/>
            <xs:element minOccurs="0" name="description" type="xs:string"/>
            <xs:element minOccurs="0" name="properties">
                <xs:complexType>
                    <xs:sequence/>
                </xs:complexType>
            </xs:element>
            <xs:element maxOccurs="unbounded" minOccurs="0" name="requiredProperties" type="xs:string"/>
            <xs:element minOccurs="0" name="definitions">
                <xs:complexType>
                    <xs:sequence/>
                </xs:complexType>
            </xs:element>
            <xs:element minOccurs="0" name="type" type="xs:string"/>
            <xs:element minOccurs="0" name="$schema" type="xs:string"/>
</xs:sequence>

$schema is not recognized and the following error occurs :

Description Resource Path Location Type s4s-att-invalid-value: Invalid attribute value for 'name' in element 'element'. Recorded reason: cvc-datatype-valid.1.2.1: '$schema' is not a valid value for 'NCName'. shift.xsd /Shift/Schemas line 34 XML Schema Problem

My spring boot code for this api rest operation /contexts POST is like this :

@PostMapping(
            path = "/contexts",
            consumes = "application/json")
    public EntityModel<Context> setContexts(@RequestBody Context context) {

    Context contextSaved = contextRepository.save(context);

    EntityModel<Context> contextEntityModel = EntityModel.of(contextSaved);

    // hateoas
    WebMvcLinkBuilder link = linkTo(methodOn(this.getClass()).getContexts());
    contextEntityModel.add(link.withRel("all-contexts"));

    return contextEntityModel;

}

When i tried with Invoke Tibco activity i have this following error :

<CausedBy> TIBCO-BW-CORE-500052: Invoke activity [post] fault.  
   <CausedBy> org.osoa.sca.ServiceRuntimeException: java.lang.RuntimeException: Cannot initialize a message part with a null value for the part item of the type {/T1674554786838Converted/JsonSchema}EntityModelContext
   <CausedBy> java.lang.RuntimeException: Cannot initialize a message part with a null value for the part item of the type {/T1674554786838Converted/JsonSchema}EntityModelContext

But the context is well filled so i do not understand why this error occurs. Any Idea ?

Even, i know POST Method should not have response... maybe be void...

I try to generate an json swagger file and import it into Tibco businessWorks. BusinessWorks create an xsd corresponding to the json file but there is an error in the xsd and the return of the post api rest method have also an error. But specially in the response of the POST method.

I would like to knbow the better way to generate json file and after import it into Tibco Businessworks.

Stack technique : Tibco Businessworks 6.9.0 Spring boot 3 Open API 3.0.1 (but i tried in 3.0.0 and i have the same issues)

0

There are 0 best solutions below