Skip to content

Commit

Permalink
Refactor instantiation, vector layers
Browse files Browse the repository at this point in the history
* Order fields according to the spec
* Remove builder pattern because `TileJSON` is writable
* Add `other` fields for any unknown fields in root and vector layers
* Restructure instantiation:
  * use `new(source)` or `new_ext(sources, version)` to create `TileJSON`
  * use `set_missing_defaults()` to replace all missing values with their defaults (only if the spec defines it)
* Remove `id` field because it is not supported by the spec
  • Loading branch information
nyurik committed May 19, 2022
1 parent d9e997b commit af2abc5
Show file tree
Hide file tree
Showing 3 changed files with 338 additions and 227 deletions.
9 changes: 7 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
### Unreleased

* for consistency, add `TileJSONBuilder::default()` - same as `::new()`
* Migrate to Rust 2021 edition
* Remove `serde_json` dependency
* update docs to match v3.0.0 spec
* add `fillzoom` field per v3.0.0 spec
* add `Center` and `Bounds` structs instead of arrays
* add `VectorLayer` struct and the `vector_layer` field
* Remove builder pattern because `TileJSON` is writable
* Add `other` fields for any unknown fields in root and vector layers
* Restructure instantiation:
* use `new(source)` or `new_ext(sources, version)` to create `TileJSON`
* use `set_missing_defaults()` to replace all missing values with their defaults (only if the spec defines it)
* Remove `id` field because it is not supported by the spec

<a name="v0.2.4"></a>
### v0.2.4 (2021-10-11)
Expand Down
6 changes: 2 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ readme = "README.md"
keywords = ["mapbox", "tilejson", "serde"]

[dependencies]
serde = { version = "1.0", features = ["derive"] }
serde = { version = "1", features = ["derive"] }
serde_json = "1"
serde_tuple = "0.5"

[dev-dependencies]
serde_json = "1.0"
Loading

0 comments on commit af2abc5

Please sign in to comment.