question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

One advantage of the built-in XmlSerializer is that we can use xsd.exe to generate an XML schema (which I use later to generate Java classes for interop between Java and C# worlds). Does ExtendedXmlSerializer support schema generation from the classes?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:20 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
zvrbacommented, Nov 9, 2018

I have dug more into XmlSerializer and found two workarounds for “difficult” types like dictionaries: IXmlSerializable and https://docs.microsoft.com/en-us/dotnet/api/system.xml.serialization.xmlschemaproviderattribute?view=netcore-2.1 The first allows to do serialization manually, while the other allows to define the schema of custom serialization that xsd.exe will use for generating schemas.

I just wish Microsoft had established a convention for serializing dictionaries that xsd.exe recognizes, like they have for Guid.

1reaction
Mike-E-angelocommented, Nov 9, 2018

Bummer… yeah this is a tricky problem. I myself absolutely despise the disparity between naming conventions, e.g. propertyName vs. PropertyName. So you will have all sorts of metadata around your classes to compensate, thereby polluting your classes, etc.

So for the v3 serializer, I am attempting to do something similar with HTML output. You describe your UI elements in XAML-esque components (DockPanel, Grid, etc.) and these elements then get generated into their HTML counterparts.

The same could be done with XSD? Essentially what is occurring is a mapping between objects in memory to an output in text. Essentially an object-view generation. Sounds simple until you actually have to implement it. 😛

I will keep this in mind as I go forward. There are actually 3 scenarios now:

  • Serialization (default)
  • HTML Generation
  • Schema (XSD) Generation

The idea is that you would create a view generator provider and have it work its magic based on the object it is processing, so in your case an XsdViewGenerator, I am thinking.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Service - Schema.org Type
Property Expected Type Description logo ImageObject or. URL An associated logo. offers Demand or. Offer review Review A review of the item. Supersedes reviews.
Read more >
[Schema] Support
Yoast Vs Schema Plugin by Hesham. Started by: Sanjay ... bad team support. Started by: hicoll ... Schema Premium: Fatal error: Cannot redeclare...
Read more >
JSON Schema | The home of JSON Schema
Learn, Get help, Shape the Community, Chat, with the JSON Schema team and Community! Getting Started · Open JSON Schema Slack Community Discussions ......
Read more >
Schema Registry Overview
Schema Registry supports schema versioning, ensuring that different versions of the schema can be used simultaneously without causing compatibility issues.
Read more >
Using Schema Markup to Better Index WordPress Sites
Schema markup can help search engines determine how to index your content accurately. This can help prevent your site from ending up on...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found