Add compatibility for PocketBase v0.22+ schema structure #9
+20
−17
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.
This pull request updates the parsing logic to support both legacy and newer versions of PocketBase collection exports.
PocketBase v0.22 (or possibly an earlier version) introduced changes to the exported collection JSON structure:
The fields array has been renamed to schema.
Each field's configuration options is now nested under an options object.
This update ensures that PocketBaseUML remains compatible with both the older and newer formats by conditionally checking for fields or schema, and accessing field options appropriately.
Since the exact version introducing this change is unclear, the update is designed to be backward compatible.
Let me know if you'd like a suggested changelog entry or commit message too.
Example