Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jan 23 23:44
    RicoSuter commented #1123
  • Jan 23 23:17
    wuzzeb synchronize #1123
  • Jan 23 23:04
    wuzzeb opened #1123
  • Jan 23 09:23
    AtosNicoS edited #1122
  • Jan 23 09:22
    AtosNicoS edited #1122
  • Jan 23 09:20
    AtosNicoS opened #1122
  • Jan 22 13:54

    RicoSuter on master

    Allow float to be converted to … (compare)

  • Jan 22 13:54
    RicoSuter closed #1121
  • Jan 22 07:24
    AtosNicoS commented #1117
  • Jan 21 18:48
    FelixS90 review_requested #1121
  • Jan 21 18:48
    FelixS90 ready_for_review #1121
  • Jan 21 18:43
    FelixS90 edited #1121
  • Jan 21 18:40
    FelixS90 opened #1121
  • Jan 21 12:01

    RicoSuter on master

    Make indexer optional for TS di… (compare)

  • Jan 21 12:01
    RicoSuter closed #1120
  • Jan 21 12:00
    RicoSuter commented #1069
  • Jan 21 11:44
    adamjones1 commented #1069
  • Jan 21 10:18
    geirsagberg review_requested #1120
  • Jan 21 08:32
    geirsagberg opened #1120
  • Jan 20 16:58
    RicoSuter commented #1119
Mickaël Cruz
@MickaelCruzDB
@RicoSuter I tried but I get : The assembly 'NJsonSchema.CodeGeneration.CSharp' containting liquid templates could not be found.
Rico Suter
@RicoSuter
You probably also need to install the NJsonSchema.CodeGeneration.CSharp package?
Mickaël Cruz
@MickaelCruzDB
@RicoSuter it's already installed, CSharpGenerator depends on it
emilw
@emilw
@RicoSuter , i am trying to use NJsonSchema to generate a set of XSD files and i struggle with resolving the Item type of an Array parameter.
As an example, i use the Petstore example swagger file and try to navigate ExtensionData.["paths"]=>["/user/createWithArray"]=>["schema"] where i get a JsonSchema with type Array back. For this one i cannot go further to the actual type due to that the Item type is just an empty JsonSchema(in the example above it's the user definition that i am after). Any suggestions or ideas? How would you find the actual type starting from the controller/path and further to each definition?
Jérémy VIGNELLES
@jeremyVignelles
If anyone has an issue with PublishTrimmed and NJsonSchema/NSwag, I just updated this doc with a workaround : https://github.com/RicoSuter/NJsonSchema/wiki/XML-Documentation#net-core
Rico Suter
@RicoSuter
Thanks for the wiki update. Is this something we could fix in NJS or is this by design?
Jérémy VIGNELLES
@jeremyVignelles
I'm not sure... You could add the lines in a .props inside the NuGet package, but maybe that would better fit in Namotion.Reflection ?
I have an internal package which depends on NSwag where I'm doing this hack
in my package, I have a build/PackageName.props, in which I have the lines I pasted on the wiki
when I reference my package, the .props gets implicitely added to the app's csproj
Jérémy VIGNELLES
@jeremyVignelles
things get a little touchy the project in which you reference it is not the target application itself (like when you reference Namotion.Reflection in NJS or NJS in NSwag), you would need to play with PrivateAssets in the PackageReference so that the .props "leaks" in your package.
I can send you sample codes if you need
Rico Suter
@RicoSuter
Yep this belongs to Namotion.Reflection can you create an issue/pr there with a sample?
Does this apply to all .net core 3.1 so that you need to optin manually alwys?
Jérémy VIGNELLES
@jeremyVignelles
It applies if you have enabled <PublishTrimmed>true</PublishTrimmed>. Will create a ticket there
Rico Suter
@RicoSuter
Ok so by default it works and only stops when you manually add this config
Jérémy VIGNELLES
@jeremyVignelles
yes, and only after a publish
Rico Suter
@RicoSuter
Then im not sure if we need a “fix” for that
But please create an issue to track it
Jérémy VIGNELLES
@jeremyVignelles
I think that there are enough warnings around this features "Please test everything" : https://docs.microsoft.com/en-us/dotnet/core/whats-new/dotnet-core-3-0#assembly-linking
It's important to consider that applications or frameworks (including ASP.NET Core and WPF) that use reflection or related dynamic features, will often break when trimmed.
A warning in the doc should be enough
Everything works fine otherwise, since those APIs are not strictly required by NSwag
only XML documentation disappears from UI and swagger.json
Jérémy VIGNELLES
@jeremyVignelles
Rico Suter
@RicoSuter
Thx
I need to understand what this trimming is but this doesnt seem to be high prio if its properly documented
Jérémy VIGNELLES
@jeremyVignelles
The basic idea is that when you do dotnet publish -c Release -r win-x64, you get the whole dotnet redistributables from the SDK
the framework assemblies, the assemblies you referenced from NuGet and Projects...
but there are sometimes when you don't need everything from the runtime (e.g. WindowsBase when publishing a .net core app)
The ILLinker from mono is used for that, it scans the applications and detect direct type usage for the whole application and dependencies
if nothing from WindowsBase is used, it gets trimmed.
Namotion.Reflection does not use directly the types, and ILLinker can't know it needs them because of the reflection
The published folder is however much lighter
Rico Suter
@RicoSuter
Makes sense
So each pkg/dll should be able to easily define a list of non trimmable deps which always applies (direct/indirect)
Not sure if props is the right tool for that but probably the only way (for now)
In the end it’s just because we dynamically look up the File type to also support netstd 1.0 (where it does not exist)
Jérémy VIGNELLES
@jeremyVignelles

Not sure if props is the right tool for that but probably the only way (for now)

You could also reference the type directly where you know it exists

Something like

#if !NETSTANDARD_1_0
typeof(System.IO.File);
typeof(...);
#endif

(Not sure about the if)

Jérémy VIGNELLES
@jeremyVignelles
I don't know the requirements of this project, but if you dropped the use of your DynamicApis, that would really help in that scenario
(and perfs would probably be better too)
just edited my issue to include that suggestion too
Jérémy VIGNELLES
@jeremyVignelles
Implemented that suggestion in RicoSuter/Namotion.Reflection#27
Jérémy VIGNELLES
@jeremyVignelles
@RicoSuter : Thanks for merging and updating, I can confirm that the latest NSwag release fixes my documentation issues.
Rico Suter
@RicoSuter
Nice. Thx for the update
Jérémy VIGNELLES
@jeremyVignelles
You're welcome :) I appreciate what you're doing
Jérémy VIGNELLES
@jeremyVignelles
I still have RicoSuter/NSwag#2613 though