zymlabs / nswag-fluentvalidation

Use FluentValidation rules instead of ComponentModel attributes to define swagger schema.
MIT License
58 stars 13 forks source link

Method not found: 'NJsonSchema.JsonObjectType NJsonSchema.JsonSchema.get_Type()' #14

Open anvaya opened 8 months ago

anvaya commented 8 months ago

I am new to this project and can not be sure what is causing this issue, I am using the new clean architecture template proposed by Jason Taylor https://github.com/JasonTaylorDev/CleanArchitecture.

During running the project the above error props up:


dotnet "C:\Users\[user]\.nuget\packages\nswag.msbuild\14.0.0-preview010\buildTransitive\../tools/Net80/dotnet-nswag.dll" run config.nswag /variables:Configuration=Debug"^C
dotnet "C:\Users\[user]\.nuget\packages\nswag.msbuild\14.0.0-preview010\buildTransitive\../tools/Net80/dotnet-nswag.dll" run config.nswag /variables:Configuration=Debug
NSwag command line tool for .NET Core Net80, toolchain v14.0.0.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))
Visit http://NSwag.org for more information.
NSwag bin directory: C:\Users\[user]\.nuget\packages\nswag.msbuild\14.0.0-preview010\tools\Net80

Executing file 'config.nswag' with variables 'Configuration=Debug'...
Launcher directory: C:\Users\[user]\.nuget\packages\nswag.msbuild\14.0.0-preview010\tools\Net80
warn: ZymLabs.NSwag.FluentValidation.FluentValidationSchemaProcessor[0]
      Error on apply rule 'NotEmpty' for property 'CreateTodoItemCommand.title'
      System.MissingMethodException: Method not found: 'NJsonSchema.JsonObjectType NJsonSchema.JsonSchema.get_Type()'.
         at ZymLabs.NSwag.FluentValidation.FluentValidationSchemaProcessor.<>c.<CreateDefaultRules>b__9_6(RuleContext context)
         at ZymLabs.NSwag.FluentValidation.FluentValidationSchemaProcessor.ApplyRulesToSchema(SchemaProcessorContext context, IValidator validator)
warn: ZymLabs.NSwag.FluentValidation.FluentValidationSchemaProcessor[0]
      Error on apply rule 'NotEmpty' for property 'UpdateTodoItemCommand.title'
      System.MissingMethodException: Method not found: 'NJsonSchema.JsonObjectType NJsonSchema.JsonSchema.get_Type()'.
         at ZymLabs.NSwag.FluentValidation.FluentValidationSchemaProcessor.<>c.<CreateDefaultRules>b__9_6(RuleContext context)
         at ZymLabs.NSwag.FluentValidation.FluentValidationSchemaProcessor.ApplyRulesToSchema(SchemaProcessorContext context, IValidator validator)
warn: ZymLabs.NSwag.FluentValidation.FluentValidationSchemaProcessor[0]
      Error on apply rule 'NotEmpty' for property 'CreateTodoListCommand.title'
      System.MissingMethodException: Method not found: 'NJsonSchema.JsonObjectType NJsonSchema.JsonSchema.get_Type()'.
         at ZymLabs.NSwag.FluentValidation.FluentValidationSchemaProcessor.<>c.<CreateDefaultRules>b__9_6(RuleContext context)
         at ZymLabs.NSwag.FluentValidation.FluentValidationSchemaProcessor.ApplyRulesToSchema(SchemaProcessorContext context, IValidator validator)
warn: ZymLabs.NSwag.FluentValidation.FluentValidationSchemaProcessor[0]
      Error on apply rule 'NotEmpty' for property 'UpdateTodoListCommand.title'
      System.MissingMethodException: Method not found: 'NJsonSchema.JsonObjectType NJsonSchema.JsonSchema.get_Type()'.
         at ZymLabs.NSwag.FluentValidation.FluentValidationSchemaProcessor.<>c.<CreateDefaultRules>b__9_6(RuleContext context)
         at ZymLabs.NSwag.FluentValidation.FluentValidationSchemaProcessor.ApplyRulesToSchema(SchemaProcessorContext context, IValidator validator)
Done.

Not sure what is causing this or how to resolve it.

geoffreytran commented 8 months ago

Let me check compatibility with NJsonSchema v11. It may need some updates.

stpanzer commented 6 months ago

Is there any update for this issue? It seems the alpha release fixes the problem but I'd rather not depend on any alpha release without knowing exactly what that entails.