Commit a5f9db0
Ports the patch fix for missing global REST section in config file (for 0.8.* version) to the main branch (#1712)
Ports the patch fix PR #1678 which was directly merged into
`release/0.8` to the `main` branch so that it is avaiable for future
versions
## Original PR description:
## Why make this change?
- Closes #1675
- For Cosmos DB NoSQL database type, DAB CLI v0.8.49 generates a REST
property within the Runtime section of the config file. However v0.7.6
does not generate this property. So, when the config file generated
using v0.7.6 is used to start the engine with v0.8.49, the absence of
the REST property causes the engine to throw exceptions.
## What is this change?
- With `v0.8.49`, these values are assumed to have non-null values
because the CLI explicitly writes out all the fields to the config
files. So, `null` checks are not performed extensively in all the
places.
- However, when a config file that is generated using `v0.7.6` is used,
it could be possible that some of the fields are `null`. The absence of
`null` checks leads to `NullReferenceExceptions` in this case.
- To avoid this, all the `Runtime` options - `Rest`, `GraphQL` and
`Host` are initialized with default values when they are `null` after
deserialization of the config file.
## How was this tested?
- [x] Existing Unit Tests and Integration Tests
- [x] Manual Tests
# Sample Requests
- Database Type: Cosmos DB NoSQL
- Config file (Runtime section):
```json
"runtime": {
"graphql": {
"enabled": true,
"path": "/graphql",
"allow-introspection": true
},
"host": {
"cors": {
"origins": [
"http://localhost:5000"
],
"allow-credentials": false
},
"authentication": {
"provider": "StaticWebApps"
},
"mode": "development"
}
}
```
- Engine starts successfully:

- GraphQL Requests work successfully:


Note: This PR is directly targeted towards `release/0.8` branch (and the
branch to make these changes was snapped off of `release/0.8`) because
the current `main` has additional changes that are related to `0.9` and
porting it over to `release/0.8` branch might not be possible.
Co-authored-by: Aniruddh Munde <[email protected]>1 parent d9f2a1a commit a5f9db0
1 file changed
+26
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
121 | 147 | | |
122 | 148 | | |
123 | 149 | | |
| |||
0 commit comments