I’m having an issue with URL mapping. Currently, I...
# permit-saas
t
I’m having an issue with URL mapping. Currently, I have a URL map configuration, and when I try to add another configuration and URL mapping, I get the following 422 error:
{
"detail": [
{      "loc": [
"body",
"mapping_rules",
0,
"should_delete"
],
"msg": "extra fields not permitted",
"type": "value_error.extra"
}
],
"body": {
"name": "internal-endpoints",
"key": "internal-endpoints",
"secret": "FeatureIsntUsedInUrlMappingFearture - see PER 12646",
"auth_mechanism": "Bearer",
"mapping_rules": [
{
"url": "<https://api.abex.com.tr/test/internal/{lang}/addresses/states>",
"url_type": null,
"http_method": "get",
"resource": "bkg_invoice",
"action": "read",
"should_delete": false
}
]
}
}
a
Hi @Taha ÇEKEN, I'm an AI assistant for Permit.io. I'll analyze available sources and get back to you shortly.
The 422 error indicates that
should_delete
is not a valid field for mapping rules in the Proxy Config API. Looking at the documented structure for mapping rules (1) , the valid fields for a mapping rule are: •
url
- proxy configuration •
method
- proxy configuration •
resource
- proxy configuration •
headers
- proxy configuration The mapping rule structure should look like this :
Copy code
{
  "url": "<https://api.stripe.com/v1/balance>",
  "method": "POST",
  "resource": "balance"
}
Or with URL parameters :
Copy code
{
  "url": "<https://api.stripe.com/v1/customers/{customer_id}>",
  "method": "GET",
  "resource": "customer",
  "headers": {
    "x-permit-example": ""
  }
}
Remove the
should_delete
field from your mapping rules. Your corrected configuration should be:
Copy code
{
  "name": "internal-endpoints",
  "key": "internal-endpoints",
  "secret": "FeatureIsntUsedInUrlMappingFearture - see PER 12646",
  "auth_mechanism": "Bearer",
  "mapping_rules": [
    {
      "url": "<https://api.abex.com.tr/test/internal/{lang}/addresses/states>",
      "method": "get",
      "resource": "bkg_invoice",
      "action": "read"
    }
  ]
}
Note that
url_type
is also not mentioned in the documented fields , so you should remove that as well. The
method
field should be used instead of
http_method
. Since you're experiencing issues with your URL mapping configuration, could you please share: 1. Which Workspace / Project / Env you are using 2. What calls you are performing (as SDK code or CURL) 3. Which PDP version you are running 4. Any relevant logs from your PDP This will help our engineer
To learn more, see the sources I considered: [[1] Detailed API Guide](https://docs.permit.io/foaz/detailed-guide)
t
im not sending this request manually, this is the network error inside permit.io web application.
o
Hi @Taha ÇEKEN this sounds like a regression following a recent change by @Alon Boshi / @Shuvy Ankor - I'll ask them to review
t
Hi, thanks for the quick response 🙏
o
It might take until next week to fix, as both of them are on a local holiday. In the meantime, consider using the API for any urgent changes
✅ 1
a
Hey @Taha ÇEKEN,The fix is live in production 🙂 You should try it yourself now
👏 1