api-management-schema-import icon indicating copy to clipboard operation
api-management-schema-import copied to clipboard

Nested schema paths aren't resolved correctly (anymore).

Open nnicksize opened this issue 1 year ago • 3 comments

Please provide us with the following information:

This issue is for a: (mark with an x)

- [ ] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [x] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

Have the following setup:

  • D [<- root directory]
    • W.wsdl
    • Schemas
      • X1.xsd
      • X2.xsd

W.wsdl includes X1.xsd by using the path "Schemas/X1.xsd". X1.xsd then includes X2.xsd by using a path relative to X1.xsd which is just "X2.xsd".

Any log messages given by the failure

Cursive bold is my addition to the error output Could not find a part of the path 'D/X2.xsd'. [<- this should search for D/Schemas/X2.xsd] Error : Stacktrace: at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirError) at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode, Boolean failForSymlink, Boolean& wasSymlink, Func4 createOpenException) at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, UnixFileMode openPermissions, Int64& fileLength, UnixFileMode& filePermissions, Boolean failForSymlink, Boolean& wasSymlink, Func4 createOpenException) at System.IO.Strategies.OSFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode) at System.IO.StreamReader.ValidateArgsAndOpenPath(String path, Encoding encoding, Int32 bufferSize) at System.IO.File.ReadAllText(String path, Encoding encoding) at Microsoft.Azure.ApiManagement.WsdlProcessor.Common.WsdlDocument.GetStringDocumentFromUri(ILog logger, String location) in /home/vsts/work/1/s/api-management-schema-import/ApiManagementSchemaImport/Microsoft.Azure.ApiManagement.WsdlProcessor.Common/WsdlDocument.cs:line 503 at Microsoft.Azure.ApiManagement.WsdlProcessor.Common.WsdlDocument.ProcessXsdImportsIncludes(WsdlDocument doc, ILog logger) in /home/vsts/work/1/s/api-management-schema-import/ApiManagementSchemaImport/Microsoft.Azure.ApiManagement.WsdlProcessor.Common/WsdlDocument.cs:line 317 at Microsoft.Azure.ApiManagement.WsdlProcessor.Common.WsdlDocument.LoadAsync(XElement documentElement, ILog logger) in /home/vsts/work/1/s/api-management-schema-import/ApiManagementSchemaImport/Microsoft.Azure.ApiManagement.WsdlProcessor.Common/WsdlDocument.cs:line 146 at Microsoft.Azure.ApiManagement.WsdlProcessor.App.Program.Main(String[] args) in /home/vsts/work/1/s/api-management-schema-import/ApiManagementSchemaImport/Microsoft.Azure.ApiManagement.WsdlProcessor.App/Program.cs:line 48

Expected/desired behavior

I expect nested schemas to be resolved correctly.

OS and Version?

Windows 11 Enterprise

Versions

dotnet sdk 8.0.300

Mention any other details that might be useful

The last working commit was 049053af68afae87e9cda8ead19c6df7a8badacf for us. We're currently fixed to that commit as a workaround.


Thanks! We'll be in touch soon.

nnicksize avatar Jun 21 '24 05:06 nnicksize

Hi @nnicksize, Could you please give details about:

  • Prompt used to execute the application? We need to know the directory where it's executed and the provided parameters.
  • Any specific encoding?

shinjiDev avatar Dec 08 '24 23:12 shinjiDev

Hi @nnicksize, Could you please give details about:

  • Prompt used to execute the application? We need to know the directory where it's executed and the provided parameters.
  • Any specific encoding?

@shinjiDev how are you?

Do you remember this pull request of mine, https://github.com/Azure-Samples/api-management-schema-import/pull/22

I always said that there were scenarios in which the inherited document in the wsdl was a type file, with an xsd extension, which was sometimes local and did not respond to an http address? I did these implementations and you told me to remove them. This was the problem I was solving

felipementel avatar Dec 27 '24 11:12 felipementel

Hi @felipementel , The change that was removed was one additional parameter to give an additional parameter that's not common in WSDL process. The main thing that we are trying to resolve here is if this one is taking the related files according to the path executed.

shinjiDev avatar Dec 27 '24 16:12 shinjiDev