-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Schema types metadata #19524
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
base: main
Are you sure you want to change the base?
Schema types metadata #19524
Conversation
@mweatherley @splo Could be interested in this :) It is a first step towards bigger refactor- namely proper JSON Schema support. But that is a much bigger change and I want to clean up my code from here a lot more: https://github.com/Leinnan/bevy_remote_ext |
/// Holds mapping of reflect data types to strings, | ||
/// later on used in Bevy Json Schema. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What kind of "strings"? Are these the schemas themselves? Type paths? Might be worth clarifying.
Same goes for other mentions of "string" in this file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have idea how to make it more clear ATM. If you have, please suggest 😅
let t = reg.type_info(); | ||
let binding = t.type_path_table(); | ||
|
||
let short_path = binding.short_path(); | ||
let type_path = binding.path(); | ||
let mut typed_schema = JsonSchemaBevyType { | ||
reflect_types: get_registered_reflect_types(reg), | ||
reflect_types: metadata.get_registered_reflect_types(reg), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, didn't realize this field was just called reflect_types
when it really just holds simplified names of type data. I wonder if it should be renamed to reflect_type_data
or type_data
or something? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I want to change the structure of schema a bit, so that if possible I would leave for next PR 😅
Co-authored-by: Gino Valente <49806985+MrGVSV@users.noreply.github.com>
Co-authored-by: Gino Valente <49806985+MrGVSV@users.noreply.github.com>
@MrGVSV Updated with almost all feedback applied. |
Objective
reflectTypes
mappings for Bevy JSON Schema.Solution
SchemaTypesMetadata
Resource that will hold mappings forTypeId
ofTypeData
. List is bigger from beggining and it is possible to expand it without forking package.Testing