Repository navigation
Fix assembly conflict issue - #208
Conversation
| #if !NETFRAMEWORK | ||
| var assemblyLoader = new AssemblyLoader.AssemblyLoader(); | ||
| assemblyLoader.RegisterAssemblyPaths(contractAssemblyPaths); | ||
| var stringSchemaTypeInfo = new AssemblyLoader.AssemblyLoader().BuildSchemaTypeInfo( |
There was a problem hiding this comment.
SchemaTypeInfo [](start = 84, length = 14)
will update naming around SchemaTypeInfo to GenerationContext #Resolved
| { | ||
| try | ||
| { | ||
| _assembliesLoadedByAssemblyName.Add(assemblyName); |
There was a problem hiding this comment.
nit. inconsistent use of the whitespace around the ( ), may want to apply one code style rule across all of the classes #Resolved
There was a problem hiding this comment.
Yes i had to disable resharper due to conflicting guidelines internal and externally, will update this.
In reply to: 284022572 [](ancestors = 284022572)
| internal static class IListExtensions | ||
| { | ||
| /// <summary> | ||
| /// |
There was a problem hiding this comment.
nit. empty summaries #Resolved
| /// <param name="operation">The operation to be updated.</param> | ||
| /// <param name="element">The xml element representing an operation in the annotation xml.</param> | ||
| /// <param name="settings">The operation filter settings.</param> | ||
| /// <returns>The list of generation errors, if any produced when processing the filter."></returns> |
There was a problem hiding this comment.
remove "> from the end #Resolved
| /// <param name="operation">The operation to be updated.</param> | ||
| /// <param name="element">The xml element representing an operation in the annotation xml.</param> | ||
| /// <param name="settings">The operation filter settings.</param> | ||
| /// <returns>The list of generation errors, if any produced when processing the filter."></returns> |
There was a problem hiding this comment.
remove "> #Resolved
| /// <param name="operation">The operation to be updated.</param> | ||
| /// <param name="element">The xml element representing an operation in the annotation xml.</param> | ||
| /// <param name="settings">The operation filter settings.</param> | ||
| /// <returns>The list of generation errors, if any produced when processing the filter."></returns> |
There was a problem hiding this comment.
remove "> #Resolved
| /// <param name="openApiDocument">The OpenAPI document to process.</param> | ||
| /// <param name="settings">The filter settings.</param> | ||
| public void Apply( | ||
| /// <returns>The list of generation errors, if any produced when processing the filter."></returns> |
| /// <param name="element">The xml element representing an operation in the annotation xml.</param> | ||
| /// <param name="settings">The operation filter settings.</param> | ||
| public void Apply(OpenApiPaths paths, XElement element, PreProcessingOperationFilterSettings settings) | ||
| /// <returns>The list of generation errors, if any produced when processing the filter."></returns> |
| /// <param name="element">The xml element representing an operation in the annotation xml.</param> | ||
| /// <param name="settings">The operation filter settings.</param> | ||
| public void Apply(OpenApiPaths paths, XElement element, PreProcessingOperationFilterSettings settings) | ||
| /// <returns>The list of generation errors, if any produced when processing the filter."></returns> |
| /// </param> | ||
| /// <param name="settings"><see cref="PreProcessingOperationFilterSettings"/></param> | ||
| void Apply(OpenApiPaths paths, XElement element, PreProcessingOperationFilterSettings settings); | ||
| /// <returns>The list of generation errors, if any produced when processing the filter."></returns> |
| /// <param name="element">The xml element representing an operation in the annotation xml.</param> | ||
| /// <param name="settings">The operation filter settings.</param> | ||
| public void Apply(OpenApiPaths paths, XElement element, PreProcessingOperationFilterSettings settings) | ||
| /// <returns>The list of generation errors, if any produced when processing the filter."></returns> |
There was a problem hiding this comment.
">...there are a few more of these in the returns comments, I'm not going to log on all of them :) #Resolved
There was a problem hiding this comment.
Joshua Whatley (JoshuaWhatley)
left a comment
There was a problem hiding this comment.
Made some suggestions. I don't see any blockers.
| string assemblyName, | ||
| string assemblyVersion) | ||
| { | ||
| var assemblyPath = assemblyPaths.FirstOrDefault(path => path.EndsWith(assemblyName + ".dll")); |
There was a problem hiding this comment.
EndsWith? wouldn't we want an exact match? #WontFix
There was a problem hiding this comment.
I see that the assemblyName passed in is not necessarily the full assemblyName. Could you update the param description so that this info is reflected. #Resolved
There was a problem hiding this comment.
b/c we are checking against assembly path, so path would be like //test/test.dll and we watch to match test.dll with the path, so ends with.
In reply to: 282706378 [](ancestors = 282706378)
| /// <param name="assemblyName">The assembly name to load.</param> | ||
| /// <param name="assemblyVersion">The assembly version to load.</param> | ||
| /// <returns>The assembly if able to load, otherwise null.</returns> | ||
| internal static Assembly TryLoadByVersion( |
There was a problem hiding this comment.
I think TryLoadByName & TryLoadByVersion can be merged into one function where the version is an optional param. #Resolved
| { | ||
| Version version = null; | ||
|
|
||
| var separatorIndex = args.Name.IndexOf(",", StringComparison.Ordinal); |
There was a problem hiding this comment.
Can we have a comment describing the format of "args.Name". Will help clarify the separators in the following logic. #Resolved
| return assembly; | ||
| } | ||
|
|
||
| assembly = AssemblyLoadUtility.TryLoadByName(assemblyPaths, assemblyName); |
There was a problem hiding this comment.
Loading twice? If this is required, please leave a comment on why. #Resolved
There was a problem hiding this comment.
| return; | ||
| } | ||
|
|
||
| if (crefFieldMap.ContainsKey(crefValue)) |
There was a problem hiding this comment.
|| with above #Resolved
| /// <param name="element">The xml element representing an operation in the annotation xml.</param> | ||
| /// <param name="settings">The operation filter settings.</param> | ||
| public void Apply(OpenApiPaths paths, XElement element, PreProcessingOperationFilterSettings settings) | ||
| /// <returns>The list of generation errors, if any produced when processing the filter."></returns> |
There was a problem hiding this comment.
remove "> at the end of the returns #Resolved
| /// <param name="element">The xml element representing an operation in the annotation xml.</param> | ||
| /// <param name="settings">The operation filter settings.</param> | ||
| public void Apply(OpenApiPaths paths, XElement element, PreProcessingOperationFilterSettings settings) | ||
| /// <returns>The list of generation errors, if any produced when processing the filter."></returns> |
| { | ||
| "Empty example element", | ||
| XElement.Parse("<parent><example></example></parent>"), | ||
| new Dictionary<string,FieldValueInfo>(), |
There was a problem hiding this comment.
nit space after , #Resolved
| "Example with url", | ||
| XElement.Parse( | ||
| "<parent><example><summary>Test Example</summary><url>https://localhost/test.json</url></example></parent>"), | ||
| new Dictionary<string,FieldValueInfo>(), |
There was a problem hiding this comment.
nit space after , #Resolved
There was a problem hiding this comment.
Do a search + replace all on <string,FieldValueInfo> as it seems this typo is in all the test changes. #Resolved
| @@ -0,0 +1,412 @@ | |||
| // ------------------------------------------------------------ | |||
There was a problem hiding this comment.
This file could use some comments to follow the logic to make it more approachable to open source contributions. #Resolved
There was a problem hiding this comment.
| { | ||
| // First, populate the document variant info attributes using the document variant option. | ||
| var variantOptions = variantElement.Element(KnownXmlStrings.Options)?.Elements(KnownXmlStrings.Option); | ||
| var variantElements = element.Elements(KnownXmlStrings.Variant); |
There was a problem hiding this comment.
do you need a null check on 'element'? #Resolved
There was a problem hiding this comment.
| InternalSchemaGenerationInfo schemaInfo = this.CrefToSchemaMap[key]; | ||
| var internalSchemaInfo = new SchemaGenerationInfo | ||
| { | ||
| Schema = schemaInfo.Schema == null |
There was a problem hiding this comment.
minor readability issue with the ternary, consider:
Schema = (schemaInfo.Schema == null)
? blah
: other blah; #Resolved
This PR brings lots of breaking changes