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

[policy][rest-to-soap] Can not save the form after updating prefill soap envelope in some case #4087

Closed
leleueri opened this issue Jul 10, 2020 · 4 comments

Comments

@leleueri
Copy link
Contributor

leleueri commented Jul 10, 2020

Expected Behavior

Editing a policy field containing some data should enable the Save button

Current Behavior

Editing a policy field containing some data doesn't always enable the Save button

Possible Solution

export.zip

Steps to Reproduce (for bugs)

  1. Go to the design view of your api
  2. Select a existing Rest-to-Soap policy
  3. Try to edit multiple time a field containing some data (like envelope)
  4. The "Save" button is disabled
  5. Edit the Charset field
  6. Now the Save button is enabled
@aelamrani
Copy link
Member

Due to the definition which contains invalid data: charset to null instead of ""

@aelamrani
Copy link
Member

Seems to be an issue as the behavior has changed since the 1.30 and now we get this kind of error when we have null on a string value of a policy:

Example:

            {
                "methods": [
                    "GET"
                ],
                "mock": {
                    "status": "200",
                    "headers": [
                        {
                            "name": "Content-Type",
                            "value": "application/json"
                        }
                    ],
                    "content": null
                },
                "description": "Get all instances of entity",
                "enabled": false
            }
{
  "message" : "Invalid policy configuration : instance type (null) does not match any allowed primitive type (allowed: [\"string\"])",
  "http_status" : 400
}

Note: we cannot get this kind of configuration from the UI but with an external tool or a template.

@aelamrani aelamrani reopened this Jul 21, 2020
@aelamrani aelamrani changed the title [Policy][Rest-to-Soap] Can not save the form after updating prefill soap envelope in some case [policy][rest-to-soap] Can not save the form after updating prefill soap envelope in some case Jul 21, 2020
@aelamrani
Copy link
Member

Getting also:

Invalid policy configuration : instance type (null) does not match any allowed primitive type (allowed: ["array"])

@leleueri
Copy link
Contributor Author

Note: In the schema-form.json to authorize null as value for optional field, use the syntax

  •  ` "type" : ["<expected-type>", "null"]`
    

ex :

   "headers" : {
      "type" : ["array", "null"],
      "title": "Headers",
      ...

leleueri added a commit to gravitee-io/gravitee-management-rest-api that referenced this issue Jul 24, 2020
…alidation.

  Remove null field on import api and after policy generation on OAI/Swagger specifications.
  This "cleaning" step avoid modifying all policies module and allow to clean policies
  and avoid unmodifiable policy screens without changing all schema-form.json

fix gravitee-io/issues#4087
aelamrani pushed a commit to gravitee-io/gravitee-management-rest-api that referenced this issue Aug 3, 2020
…alidation.

  Remove null field on import api and after policy generation on OAI/Swagger specifications.
  This "cleaning" step avoid modifying all policies module and allow to clean policies
  and avoid unmodifiable policy screens without changing all schema-form.json

fix gravitee-io/issues#4087
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
API Management
Awaiting triage
Development

No branches or pull requests

2 participants