[WIP] Generate C# classes from XSD files in TAKconn-DotNet#2
Draft
[WIP] Generate C# classes from XSD files in TAKconn-DotNet#2
Conversation
Copilot stopped work on behalf of
koxitos due to an error
November 17, 2025 11:04
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Thanks for asking me to work on this. I will get started on it and keep this PR's description up to date as I form a plan and make progress.
Original prompt
Generate .NET C# classes from the XSD files located in WOT.TAK.Connection/protocol/xml/atak in the TDF-PL/TAKconn-DotNet repository (ref: e9f5b9d). Requirements and acceptance criteria:
Background:
Tasks for the coding agent (detailed and actionable):
Inspect the XSD files under WOT.TAK.Connection/protocol/xml/atak and resolve includes/imports appropriately. Ensure the generator sees the full schema graph so type references (e.g., event_point, link, contact, color, status, etc.) are resolved.
Generate C# classes for the schema graph. Generation details:
Add the generated .cs files to the repository under a new folder: WOT.TAK.Connection/protocol/xml/atak/Generated (or under a shared project means). Name files sensibly (Event.cs, Link.cs, Point.cs, Contact.cs, Color.cs, Status.cs, etc.).
Add or update a project file (if necessary) so the generated files are included in the build. Prefer to add an MSBuild include in the WOT.TAK.Connection project (or a new shared project) so the classes are compiled. If changing csproj, use globbing (Include="protocol/xml/atak/Generated/**/*.cs") and set where appropriate.
Add a README in the Generated folder that documents how the classes were generated (tool used, command-line, generator options) and how to regenerate them locally (e.g., xsd.exe / xsd2code / svcutil or dotnet-xscgen if used). Include the exact command line(s).
Validation: include a unit test or small console program under tests/ (or an existing test project) to demonstrate round-trip serialization of the main element (event) to XML and validate that serialized XML validates against the original XSD graph using XmlSchemaSet (use the BaseDirResolver pattern to load the schemas). The test should exercise at least one populated Event object and validate successfully.
Ensure no XSD 1.1-only constructs are required by the generator; if any XSD 1.1 constructs exist, add a note in the README explaining any incompatibilities and how they were handled (or that a different generator is required).
Avoid duplicate global element declarations: ensure the PR adds only the generated C# files and does not alter the XSD files. The schema-loading code used during generation should avoid adding both the main schema and all included files in a way that causes duplicates.
Deliverables in the PR:
PR description guidance:
Notes for the implementer:
Repository to commit changes: TDF-PL/TAKconn-DotNet
Do not set assignees. Please create a single pull request branch and include the changes described above. Provide the PR once done.
This pull request was created as a result of the following prompt from Copilot chat.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.