Skip to content
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

Schema::properties() isn't public #128

Open
vvuk opened this issue Apr 17, 2024 · 2 comments
Open

Schema::properties() isn't public #128

vvuk opened this issue Apr 17, 2024 · 2 comments

Comments

@vvuk
Copy link

vvuk commented Apr 17, 2024

Schema::properties() is currently pub(crate), but is there any reason it shouldn't be just pub? It's very useful for being able to inspect the properties in a schema; I couldn't find any other way of getting this list.

@n4r1b
Copy link
Owner

n4r1b commented Apr 18, 2024

The properties were meant to be tied to the Parser so ideally you would use the Parser instance to access them. I'm not opposed to making this Schema::properties() if there're a good use case for this, or we could extend the Schema to cover this cases without directly exposing the properties. Let me know what you prefer @vvuk!
Could you also give me some examples on use cases where you want to inspect the properties :)

@gadol21
Copy link

gadol21 commented Oct 19, 2024

@n4r1b Adding a use case that I have for this -
I have an application that uses TraceLogging for its logs. I want to create a real-time log viewer. To do that I need a generic way to parse EventRecord, not knowing what properties exist in advance, because each log might contain different properties, and I don't want to need to need adjust the log viewer to know all the logs' properties.
For that I need the property names exposed, as I simply want to fetch all properties, and I don't know the property names for a particular event.
It doesn't matter to me if the properties are exposed from the parser or the schema object as long as there is some way to access them.

If deemed acceptable, I'll be happy to contribute this change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants