Class DefaultSchemaDefinitionNamingStrategy
- java.lang.Object
-
- com.github.victools.jsonschema.generator.naming.DefaultSchemaDefinitionNamingStrategy
-
- All Implemented Interfaces:
SchemaDefinitionNamingStrategy
,StatefulConfig
public class DefaultSchemaDefinitionNamingStrategy extends Object implements SchemaDefinitionNamingStrategy
Default implementation of aSchemaDefinitionNamingStrategy
using the output ofTypeContext.getSimpleTypeDescription(ResolvedType)
as definition name/key.
-
-
Constructor Summary
Constructors Constructor Description DefaultSchemaDefinitionNamingStrategy()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getDefinitionNameForKey(DefinitionKey key, SchemaGenerationContext generationContext)
Getter for the name/key in the "definitions"/"$defs" to represent the givenDefinitionKey
.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.github.victools.jsonschema.generator.naming.SchemaDefinitionNamingStrategy
adjustDuplicateNames, adjustNullableName
-
Methods inherited from interface com.github.victools.jsonschema.generator.StatefulConfig
resetAfterSchemaGenerationFinished
-
-
-
-
Method Detail
-
getDefinitionNameForKey
public String getDefinitionNameForKey(DefinitionKey key, SchemaGenerationContext generationContext)
Description copied from interface:SchemaDefinitionNamingStrategy
Getter for the name/key in the "definitions"/"$defs" to represent the givenDefinitionKey
.- Specified by:
getDefinitionNameForKey
in interfaceSchemaDefinitionNamingStrategy
- Parameters:
key
- definition reference for a type (there may be multiple different keys for the same type if custom definitions are involved)generationContext
- generation context providing access to the applied configuration and type context- Returns:
- name/key in "definitions"/"$defs" for the indicated subschema
- See Also:
SchemaGenerationContext.getGeneratorConfig()
,SchemaGenerationContext.getTypeContext()
-
-