These are chat archives for NJsonSchema/NJsonSchema

28th
Feb 2018
Stijn Herreman
@stijnherreman
Feb 28 13:23
Hi, I'm trying to build the solution but I'm seeing errors:
  • a bunch of these: Assets file 'C:\Users\herremanst\Desktop\NJsonSchema\src\NJsonSchema\obj\project.assets.json' not found. Run a NuGet package restore to generate this file.
  • and this one: Error occurred while restoring NuGet packages: The operation failed as details for project NJsonSchema.CodeGeneration.CSharp could not be loaded.
Rico Suter
@RSuter
Feb 28 13:35
try to clean everything first, delete all obj/ and bin/ directories
Stijn Herreman
@stijnherreman
Feb 28 13:44
it's a fresh clone
but seems to be a visual studio bug
trying various workarounds
Rico Suter
@RSuter
Feb 28 13:49
i think project.assets.json was an output when .net core had json based projects (xproj)!? i also had this problem during the time when i migrated to .net core and switched between full .net and .net core branches...
Stijn Herreman
@stijnherreman
Feb 28 14:08
Fixed it by running dotnet restore instead of letting VS do the restore.
Rico Suter
@RSuter
Feb 28 14:23
ok.. i also just fixed the test
Stijn Herreman
@stijnherreman
Feb 28 15:23
Does an edit to a wiki page generate a pull request or is it applied instantly? I'd like to add a remark to the https://github.com/RSuter/NJsonSchema/wiki/Inheritance
Rico Suter
@RSuter
Feb 28 15:24
instantly
Stijn Herreman
@stijnherreman
Feb 28 15:24
OK, I'll type it here then so you can see if it's a good change :)
Rico Suter
@RSuter
Feb 28 15:25
its fine to directly change it, there's is a history and i'll check the changes from time to time :)
Stijn Herreman
@stijnherreman
Feb 28 15:25
ah ok :)
Rico Suter
@RSuter
Feb 28 15:25
btw: the wiki is a different repo than the code repo on github this is why you can change it without PRs
but for future project, i think it'd be better to create just a /docs folder with .md files - this way you can create PRs with new features and also the associated docs change...
DerekChasse
@DerekChasse
Feb 28 17:39
Is there a way to determine the complete list of properties for a given schema? I am looking at schemas will multiple allOf values defined.
I've got the following now: schema.AllInheritedSchemas.SelectMany(s => s.ActualProperties)
but I'm wondering what impact oneOf's will have.
And I'd ideally like to preserve the JsonSchema4 object, and not deal with a collection of KeyValuePair<string, JsonProperty>
In my scenario, I'm not concerned with code generation, so the fact that I'd be altering the inheritance structure of the object isn't an issue for me.
DerekChasse
@DerekChasse
Feb 28 17:58
Sorry, by multiple allOf, I should say that there are multiple inherited schemas potentially with multiple levels.
Rico Suter
@RSuter
Feb 28 18:00
I think allinheritedschemas and actualproperties only work for single inheritance (used for code gen) you have to check the implementation and maybe implement own properties for your scenario
DerekChasse
@DerekChasse
Feb 28 18:13
I'm probably actually ok with single inheritance... I meant to say that I have a child => parent => grandparent inheritance relationship
Rico Suter
@RSuter
Feb 28 19:21
I think allinheritedschemas returns all schemas in the i chain
DerekChasse
@DerekChasse
Feb 28 19:22
It seems to do so, however I'm running into issues now with unioning inherited properties with local schema properties
These local schema properties are defined within a local allOf and not within schema.Properties