Enhance WsdlDocument handling on includes and add example WSDL/XSD files #29
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.
Purpose
When trying to process a WSDL with includes, if any include defines a xmlns:xsd attribute, it will fail with a key error, since dotnet XSL parser always adds an xmlns:xs attribute and the ToDictionary will have a key clash.
This PR will make it so that you can have multiple times the same namespace when doing includes. Which is correct, since the included namespace could use an existing namespace on a different property.
Enhancements to Namespace Handling:
ApiManagementSchemaImport/Microsoft.Azure.ApiManagement.WsdlProcessor.Common/WsdlDocument.cs
: Improved theAddXmlnsAndChangePrefixReferenced
method by capturing all declaredxmlns
attributes and using a composite key for the namespace dictionary to handle potential conflicts.Addition of New Schema and WSDL Files:
examples/includeExample/additional.xsd
: Added a new schema file defining anAdditionalElement
of typexsd:string
.examples/includeExample/common.xsd
: Added a new schema file defining aCommonElement
of typexsd:string
.examples/includeExample/example.wsdl
: Added a new WSDL file defining a web service with operations, bindings, and messages.examples/includeExample/schema1.xsd
: Added a new schema file with an importedcommon.xsd
and defined a complex typeExampleType
with anexampleField
.examples/includeExample/schema2.xsd
: Added a new schema file with an importedcommon.xsd
, includedadditional.xsd
, and defined a complex typeExampleType
with anexampleField
.Does this introduce a breaking change?
Pull Request Type
What kind of change does this Pull Request introduce?
How to Test