Priority Variables
When resolving values for mappings in the Serverless API Gateway, it's crucial to understand the priority order between local (config) variables and global variables.
Variable Resolution Hierarchy
Why Local Variables Take Precedence
Example
"variables": {
"global_variable": "global_value",
"database-url": "sqlite://primary-db.sqlite" // Global variable
},
"paths": [
{
"method": "GET",
"path": "/api/v1/special-endpoint",
"variables": {
"database-url": "sqlite://special-db.sqlite" // Local variable takes precedence
}
}
]Conclusion
Last updated