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

Handle duplicate namespace (struct) names #1

Open
jessepeterson opened this issue Apr 21, 2023 · 3 comments
Open

Handle duplicate namespace (struct) names #1

jessepeterson opened this issue Apr 21, 2023 · 3 comments

Comments

@jessepeterson
Copy link
Owner

Some commands like DeviceInformation and Settings have duplicate defined structures in the schema (e.g. OrganizationInfo. These can clash and cause compile failures.

An earlier version of the code generator prefixed all structures with a shortened version of the command name. For example "DI" would prefix all "DeviceInformation" structures. So this would be DIOrganizationInfo and SOrganizationInfo. You could prefix the whole command name, of course, but then we start getting really long names.

@jessepeterson
Copy link
Owner Author

We could try to deduplicate the structures ourselves but this has problems when we're only processing a single (or subset) of commands that do not take into consideration the files not being processed. Also the de-duplication effort would need to compare structures to see if they're actually, truly, different. A custom deep compare. Which sounds annoying.

@kilpatds
Copy link

I was thinking "Oh, I'm sure they're really the same structure"

Uh, they're not.

settings/OrganizationInfo : a dictionary of Organization{Name,ShortName,Address,Phone,Email,Magic} strings.
infomation/OrganizationInfo: a string (key to the other one. I think is supposed to match with "Magic" ??)

@jessepeterson
Copy link
Owner Author

Looks like settings.yaml and application.extensions.listactive.yaml generate duplicate structs with some other thing that I haven't looked into.

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

2 participants