-
-
Notifications
You must be signed in to change notification settings - Fork 91
global-state expression #1044
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
Merged
louwers
merged 45 commits into
maplibre:main
from
tomtom-forks:NAV-171460-global-state-expression
Apr 22, 2025
Merged
global-state expression #1044
Changes from 1 commit
Commits
Show all changes
45 commits
Select commit
Hold shift + click to select a range
6bb780f
add global-state expression
zbigniewmatysek-tomtom b088f0e
self review
zbigniewmatysek-tomtom 85616b8
Merge branch 'main' of github.com:tomtom-forks/maplibre-style-spec in…
zbigniewmatysek-tomtom c9724a6
code hygiene
zbigniewmatysek-tomtom c6034a0
add integration tests
zbigniewmatysek-tomtom bbb988c
add unit tests
zbigniewmatysek-tomtom 7987b5c
update sdk-support
zbigniewmatysek-tomtom d2cd15f
use getOwn
zbigniewmatysek-tomtom 2031d0e
add state root property
zbigniewmatysek-tomtom 6af796a
state property validation
zbigniewmatysek-tomtom 1dd679e
validate state keys existance when global-state is used
zbigniewmatysek-tomtom a776b4c
improve expression parsing
zbigniewmatysek-tomtom 377cc6f
refactor
zbigniewmatysek-tomtom 2c64ac7
temporarily build for testing purposes
zbigniewmatysek-tomtom dba4c4f
improve docs
zbigniewmatysek-tomtom cd861b9
schema support
zbigniewmatysek-tomtom 7e70626
cleanout
zbigniewmatysek-tomtom b98c7bd
export schema validator
zbigniewmatysek-tomtom ed13aa9
minor fix
zbigniewmatysek-tomtom c0e90a3
cleanout
zbigniewmatysek-tomtom e476181
update types
zbigniewmatysek-tomtom cd68ddb
docs
zbigniewmatysek-tomtom 3bc66a0
minor fixes
zbigniewmatysek-tomtom 830552b
add schema ts types
zbigniewmatysek-tomtom 915a264
cleanout
zbigniewmatysek-tomtom bdab151
fixes + increase test coverage
zbigniewmatysek-tomtom fe0fe42
review fixes
zbigniewmatysek-tomtom 9dd0595
make default optional in the ts types
zbigniewmatysek-tomtom 09f9767
docs update
zbigniewmatysek-tomtom 5281217
docs fixes
zbigniewmatysek-tomtom 6f3ffc8
review fixes
zbigniewmatysek-tomtom 1dfc05f
minor fix
zbigniewmatysek-tomtom 2ff83bc
Merge branch 'main' into NAV-171460-global-state-expression
zbigniewmatysek-tomtom 3d356fb
review fixes
zbigniewmatysek-tomtom 6300620
Merge branch 'NAV-171460-global-state-expression' of github.com:tomto…
zbigniewmatysek-tomtom 7a26fe1
remove annotations section
zbigniewmatysek-tomtom 81d498d
remove validation
zbigniewmatysek-tomtom 9c042f5
Merge branch 'main' into NAV-171460-global-state-expression
zbigniewmatysek-tomtom c15c12e
cleanout
zbigniewmatysek-tomtom ba2a103
Merge branch 'NAV-171460-global-state-expression' of github.com:tomto…
zbigniewmatysek-tomtom 4e591d2
add changelog
zbigniewmatysek-tomtom ce515fb
Review fix: update src/reference/v8.json
stanislawpuda-tomtom 205d379
Review fix: update src/reference/v8.json
stanislawpuda-tomtom 82b028d
Merge branch 'main' of https://github.com/tomtom-forks/maplibre-style…
stanislawpuda-tomtom 2a27194
fix links
stanislawpuda-tomtom File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
# Schema | ||
zbigniewmatysek-tomtom marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
The value for `state` properties. Defines the default state property value, and its type. | ||
|
||
The schema definition follows a subset of [JSON Schema](https://json-schema.org/) but is more strict in terms of what properties are required. | ||
zbigniewmatysek-tomtom marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
## Data types | ||
|
||
### enum | ||
|
||
|
||
The `enum` keyword is used to restrict a value to a fixed set of values. It must be an array with at least one element, where each element is unique. | ||
|
||
```json | ||
{ | ||
"enum": ["red", "amber", "green"], | ||
"default": "red" | ||
} | ||
``` | ||
|
||
### number | ||
|
||
The `number` type is used for any numeric type, either integers or floating point numbers. | ||
|
||
```json | ||
{ | ||
"type": "number", | ||
"minimum": 0, // optional | ||
zbigniewmatysek-tomtom marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"maximum": 100, // optional | ||
"default": 42 | ||
} | ||
``` | ||
|
||
You can define range using optional `minimum` and `maximum` keywords. Range is inclusive. | ||
|
||
### string | ||
|
||
The `string` type is used for strings of text. It may contain Unicode characters. | ||
|
||
```json | ||
{ | ||
"type": "string", | ||
"default": "Montréal" | ||
} | ||
``` | ||
|
||
### boolean | ||
|
||
The `boolean` type matches only two special values: `true` and `false`. | ||
|
||
```json | ||
{ | ||
"type": "boolean", | ||
"default": true | ||
} | ||
``` | ||
|
||
### array | ||
|
||
Arrays are used for ordered elements. Type of items in an array is defined with required `items`. Allowed item types are all schema types. | ||
|
||
```json | ||
{ | ||
"type": "array", | ||
"items": { | ||
"type": "string" | ||
}, | ||
"default": ["red", "amber", "green"] | ||
} | ||
``` | ||
|
||
## Default values | ||
|
||
A default value is required for each data type and is defined with the `default` keyword. The value of the default will be validated against the data type during style validation. | ||
|
||
|
||
## Annotations | ||
|
||
The `title` and `description` keywords must be strings. A "title" will preferably be short, whereas a "description" will provide a more lengthy explanation of the purpose of the data described by the schema. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.