wso2 / micro-integrator

The cloud-native configuration driven runtime that helps developers implement composite microservices.

Home Page:https://wso2.com/integration/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[MI 4.2.0] Management API does not validate query configuration in a Data Service.

SameeraSI opened this issue · comments

Description

When nested queries are used in a data service without the 'element' attribute in the first query, the data service can be deployed in MI without any issues. However, the content of the data service cannot be retrieved using Management APIs.

Steps to Reproduce

  1. Create a data service using following structure.
           .
           .
           .
   <query id="GetQuery" useConfig="datasource">
        <sql>
            [query]
        </sql>
        [parameters]
        <result rowName="value" element="value">
            <element name="validityChecks">
                <call-query href="GetQuery2" requiredRoles="">
                    [parameters]
                </call-query>
            </element>
        </result>
    </query>

    <query id="GetQuery2" useConfig="datasource">
        <sql>
           [query]
        </sql>
        [parameters]
        <result rowName="excludedFunctions">
            [elements]
        </result>
    </query>
        .
        .
        .
  1. Invoke the management API with an access token.
    https://localhost:9164/management/data-services?dataServiceName=[ServiceName]

  2. You will receive a response with an empty body and a 200 status code as follows:

316171433-dc06ce41-24fb-4f2f-b7a3-0c4a066cc571

Affected Component

MI

Version

4.2.0

Environment Details (with versions)

No response

Relevant Log Output

No response

Related Issues

No response

Suggested Labels

No response