Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improving Builder Utilization in axis2.xml.j2 for defaultContentType Configuration #3322

Closed
Abshan opened this issue May 3, 2024 · 1 comment

Comments

@Abshan
Copy link

Abshan commented May 3, 2024

The current implementation in axis2.xml.j2 for setting the defaultContentType parameter in the Axis2 configuration file (axis2.xml) includes unnecessary quotation marks around the parameter attribute value. This practice prevents the utilization of the defined builder for the defaultContentType parameter.

For example,

In the axis2.xml.j2 file contains the following instruction to set the defaultContentType parameter value,

 {% if transport.default_content_type is defined %}
    <parameter name="defaultContentType" locked="false">"{{transport.default_content_type}}"</parameter>
 {% endif %}

So if we add the following configuration snippet to the deployment.toml file,

[transport]
default_content_type = "application/sample"

Then the above config would reflect in the axis2.xml file as shown below,

<parameter name="defaultContentType" locked="false">"application/sample"</parameter>

Because of the quotation marks around the parameter attribute value, the builder for defaultContentType is not being used. But, when we remove the quotation marks from the axis2.xml.j2 file as shown below, the defined builder gets used.

 {% if transport.default_content_type is defined %}
    <parameter name="defaultContentType" locked="false">{{transport.default_content_type}}</parameter>
 {% endif %}

This needs to be rectified.

@arunans23
Copy link
Member

There is an alternative parameter that we can add in deployment.toml.

[[transport.parameters]]
name = "DEFAULT_REQUEST_CONTENT_TYPE"
value = "empty/content"

@arunans23 arunans23 added this to the 4.3.0-alpha milestone Jun 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants