Comments (1)
I was able to take another approach and create a custom target as shown below.
Of note, it would be really amazing if the Nuget package included a first-class Json-To-Dotnet
MSBuild Task. It would be very little additional effort.
https://natemcmaster.com/blog/2017/07/05/msbuild-task-in-nuget/
<Target Name="GenerateOpenFolderSources" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ToDotNetCLI>$(PkgMicrosoft_Json_Schema_ToDotNet)\tools\net461\Microsoft.Json.Schema.ToDotNet.Cli.exe</ToDotNetCLI>
<SchemaDirectory>Resources</SchemaDirectory>
<GenOutDir>$(MSBuildProjectDirectory)</GenOutDir>
<Namespace>MyNamespace</Namespace>
<ClassName>MyClass</ClassName>
<MySchemaFile>$(SchemaDirectory)/myschema.json</MySchemaFile>
<MySchemaName>MySchemaName</MySchemaName>
</PropertyGroup>
<Exec Command="$(ToDotNetCLI) -f -n $(Namespace) -o $(GenOutDir) -r $(MySchemaName) -e $(MySchemaName) -s $(MySchemaFile)"/>
</Target>
from jschema.
Related Issues (20)
- Add JsonProperty(DefaultValueHandling.Include) for required primitives
- Provide options for marking types as sealed, members as virtual HOT 1
- Need a mechanism to allow object properties for type nullable<int>
- Allow generated Init methods to be protected
- Support 64-bit integer properties via codegen hint
- Unions with Relative Uris don't parse correctly HOT 1
- Implement value equality on JsonPointer
- Don't report validation error locations or artifact locations as absolute URIs.
- Evaluating JPointer can report incorrect start line HOT 2
- Json.Schema.Validation, wrong result
- Support partial classes HOT 1
- Support of generate field order attribute
- Auto-generate IComparer implementation code for all entities HOT 1
- check possibility to merge `JSON1006.ValueTooLarge` and `JSON1008.ValueTooSmall` into one `ValueOutOfRange` rule
- See if jschema can change to support Big Integer instead of max 64 bit integer HOT 1
- This repo is missing important files
- Support UUIDs HOT 1
- Evaluate and add option `--generate-json-number-as` HOT 1
- Examine `Equals` methods and add tests
- Improvement: remove unnecessary initialization of property default value in ToDotNet
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jschema.