Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

System.MissingMethodException: Method not found: 'Void NJsonSchema.JsonSchema.set_Type(NJsonSchema.JsonObjectType) #1679

Open
vasiles opened this issue Mar 5, 2024 · 1 comment

Comments

@vasiles
Copy link

vasiles commented Mar 5, 2024

Hi, I have a controller and generate the spec from it with OperationProcessor. With v13.20, everything was fine.
I add an operation like this:

..
operation.Parameters.Add(new OpenApiParameter
{
Name = "name",
Kind = OpenApiParameterKind.Header,
Schema = new NJsonSchema.JsonSchema { Type = NJsonSchema.JsonObjectType.String },
Description = "description",
IsRequired = false,
});
..

After upgrading to v14.0.3, I get the following error.

NSwag command line tool for .NET Core Net60, toolchain v14.0.3.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.3\tools\Net60

  Executing file '.\.swagger\AspNetCoreToOpenApiDocument.nswag' with variables 'ProjectPath=C:\Service.csproj,Output=C:\Service\../ApiSpecifications/Specification.json,Configuration=Debug,runtime=Net60'...
  Launcher directory: C:\Users\user\.nuget\packages\nswag.msbuild\14.0.3\tools\Net60

---> System.MissingMethodException: Method not found: 'Void NJsonSchema.JsonSchema.set_Type(NJsonSchema.JsonObjectType)'.
     at MyCompany.NSwag.AddChannelHeaderParametersFilter.Process(OperationProcessorContext context)
     at NSwag.Generation.AspNetCore.AspNetCoreOpenApiDocumentGenerator.RunOperationProcessors(OpenApiDocument document, ApiDescription apiDescription, Type controllerType, MethodInfo methodInfo, OpenApiOperationDescription operationDescription, List`1 allOperations, OpenApiDocumentGenerator generator, OpenApiSchemaResolver schemaResolver)
....

Any idea what is going on @RicoSuter

thnx

@gitlsl
Copy link

gitlsl commented Mar 18, 2024

I run into same issue?
System.TypeLoadException:“Could not load type 'NJsonSchema.JsonObjectType' from assembly 'NJsonSchema, Version=11.0.0.0, Culture=neutral, PublicKeyToken=c2f9c3bdfae56102'.”

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants