-
Notifications
You must be signed in to change notification settings - Fork 136
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
'@JsonClassDescription' annotation is not taken into account #136
Comments
Version |
I try with 2.9.9 version and i have the same issue (JsonPropertyDescription annotation is ok but not JsonClassDescription annotation) Here is the example package test;
import com.fasterxml.jackson.annotation.JsonClassDescription;
import com.fasterxml.jackson.annotation.JsonPropertyDescription;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.module.jsonSchema.factories.SchemaFactoryWrapper;
@JsonClassDescription("Description of calss Test")
public class Test {
@JsonPropertyDescription("Description of property name")
private String name;
public Test() {
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public static void main(String[] args) throws JsonProcessingException {
ObjectMapper mapper = new ObjectMapper();
SchemaFactoryWrapper visitor = new SchemaFactoryWrapper();
mapper.acceptJsonFormatVisitor(Test.class, visitor);
com.fasterxml.jackson.module.jsonSchema.JsonSchema jsonSchema = visitor.finalSchema();
System.out.println(mapper.writerWithDefaultPrettyPrinter().writeValueAsString(jsonSchema));
}
} output {
"type" : "object",
"id" : "urn:jsonschema:test:Test",
"properties" : {
"name" : {
"type" : "string",
"description" : "Description of property name"
}
}
} |
Sounds like support for class description is missing then (I remember addition of property descriptions). Contributions welcome! |
I checked that code indeed does not fetch this information. It would be available from So: someone would need to connect the dots. I do not work on this module, but maybe someone else has time and interest. |
I decided to use the Swagger annotations instead with:
Create the Swagger module and add it to config builder:
|
I think, as a part of this effort, |
|
Added |
@JsonClassDescription supported by jackson-module-jsonSchema? I have tried to generate JSON schema with jackson-module-jsonSchema 2.7.4 However, it ignores @JsonClassDescription annotation
The text was updated successfully, but these errors were encountered: