networknt / networknt/json-schema-validator
Unknown keyword openapi when creating a schema of an openAPI 3.0 file
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 1.1k
- Forks
- 352
- Avg merge
- 3d 13h
- Merged PRs (30d)
- 5
Description
Im trying to validate a json playload against a schema defined in a openAPI 3.0 file.
I was following this: https://github.com/networknt/json-schema-validator/blob/1.5.9/doc/openapi.md
When i do this and create a JsonSchema for my file i get a few "unknown keyword" warnings:
2025-10-24 12:07:40,920 WARN [main] com.networknt.schema.UnknownKeywordFactory:37 Unknown keyword openapi - you should define your own Meta Schema. If the keyword is irrelevant for validation, just use a NonValidationKeyword or if it should generate annotations AnnotationKeyword
2025-10-24 12:07:40,929 WARN [main] com.networknt.schema.UnknownKeywordFactory:37 Unknown keyword info - you should define your own Meta Schema. If the keyword is irrelevant for validation, just use a NonValidationKeyword or if it should generate annotations AnnotationKeyword
2025-10-24 12:07:40,930 WARN [main] com.networknt.schema.UnknownKeywordFactory:37 Unknown keyword security - you should define your own Meta Schema. If the keyword is irrelevant for validation, just use a NonValidationKeyword or if it should generate annotations AnnotationKeyword
2025-10-24 12:07:40,930 WARN [main] com.networknt.schema.UnknownKeywordFactory:37 Unknown keyword servers - you should define your own Meta Schema. If the keyword is irrelevant for validation, just use a NonValidationKeyword or if it should generate annotations AnnotationKeyword
2025-10-24 12:07:40,930 WARN [main] com.networknt.schema.UnknownKeywordFactory:37 Unknown keyword paths - you should define your own Meta Schema. If the keyword is irrelevant for validation, just use a NonValidationKeyword or if it should generate annotations AnnotationKeyword
2025-10-24 12:07:40,930 WARN [main] com.networknt.schema.UnknownKeywordFactory:37 Unknown keyword components - you should define your own Meta Schema. If the keyword is irrelevant for validation, just use a NonValidationKeyword or if it should generate annotations AnnotationKeyword
I would like to fix those warnings to keep my log clean if possible.
I also tried loading a 3.0 meta schema from the class path like this:
JsonSchemaFactory factory = JsonSchemaFactory.getInstance(SpecVersion.VersionFlag.V4, builder -> builder
.defaultMetaSchemaIri("classpath:oas/3.0/schema/2024-10-18")
.metaSchema(JsonMetaSchema.builder("classpath:oas/3.0/schema/2024-10-18").build()));
JsonSchema baseSchema = factory.getSchema(SchemaLocation.of("classpath:openapi.yaml"));
but that also now gives the "items" keyword as unknwon.
I dont really know what im doing wrong or what i need to do to fix this.
Lib version: 1.5.9
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with doc/openapi.md and the JsonSchemaFactory/JsonMetaSchema configuration shown in the report. Compare the documented OpenAPI 3.0 setup with the 1.5.9 implementation, focusing on why openapi, paths, components, and items are treated as unknown keywords. Done means the supported configuration validates the supplied OpenAPI file without these warnings.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, openapi
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100