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

Unable to create JsonSchema with multiple UnrecognizedKeywords via JsonSchemaBuilder #516

Closed
1 task done
mdekrey opened this issue Sep 4, 2023 · 2 comments · Fixed by #518
Closed
1 task done
Labels
bug Something isn't working pkg:schema

Comments

@mdekrey
Copy link
Contributor

mdekrey commented Sep 4, 2023

Nuget Package

JsonSchema.Net

Package Version

5.2.0

Operating System

None

.Net Target (if relevant, please specify the version in the description)

None

A clear and concise description of the bug

When using JsonSchemaBuilder, multiple UnrecognizedKeywords may be added. However, upon attempting to Build(), the keyword Types are checked instead of using KeywordExtensions.Keyword

Please add test code or steps to reproduce the behavior

var builder = new JsonSchemaBuilder();
builder.Add(new UnrecognizedKeyword("foo", null));
builder.Add(new UnrecognizedKeyword("bar", null));
builder.Build();

What did you expect?

I expected the JsonSchemaBuilder to support the same structures as could be created via Deserialization, or that the constructors of JsonSchema used by the JsonSchemaBuilder would be available publicly from the library..

Is there any other information you'd like to share regarding this bug?

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@mdekrey mdekrey added the bug Something isn't working label Sep 4, 2023
@gregsdennis
Copy link
Owner

Thanks for reporting this. This is a pretty simple fix.

@mdekrey
Copy link
Contributor Author

mdekrey commented Sep 4, 2023

Thanks for implementing it so quickly - I expected a chance to write a PR for this this morning, too! 😁

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working pkg:schema
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants