Comments (4)
Your example looks like it should work. Does it not?
This is the current default mapping - if using html5EnabledSchema:
customType2FormatMapping = Map[String,String](
// Java7 dates
"java.time.LocalDateTime" -> "datetime-local",
"java.time.OffsetDateTime" -> "datetime",
"java.time.LocalDate" -> "date",
// Joda-dates
"org.joda.time.LocalDate" -> "date"
)
Joda DateTime should probably be added to that list.
from mbknor-jackson-jsonschema.
Hi,
Thanks fro the quick response. It does work appropriately I am actually looking something a bit simpler for the serialization. Our JSON response just outputs ISO timestamps 2017-01-18T19:05:29+00:00
. While the JODA DateTime has many parts.
Simple Format:
{
"DateTime": {
"type": "string",
"format": "date-time"
}
}
Full Serialization:
{
"DateTime": {
"type": "object",
"additionalProperties": false,
"format": "date-time",
"properties": {
"millisOfDay": {
"type": "integer"
},
"monthOfYear": {
"type": "integer"
},
"hourOfDay": {
"type": "integer"
},
"minuteOfHour": {
"type": "integer"
},
"secondOfMinute": {
"type": "integer"
},
"millisOfSecond": {
"type": "integer"
},
"weekOfWeekyear": {
"type": "integer"
},
"weekyear": {
"type": "integer"
},
"yearOfEra": {
"type": "integer"
},
"yearOfCentury": {
"type": "integer"
},
"centuryOfEra": {
"type": "integer"
},
"secondOfDay": {
"type": "integer"
},
"minuteOfDay": {
"type": "integer"
},
"year": {
"type": "integer"
},
"dayOfMonth": {
"type": "integer"
},
"dayOfWeek": {
"type": "integer"
},
"era": {
"type": "integer"
},
"dayOfYear": {
"type": "integer"
},
"chronology": {
"$ref": "#/definitions/Chronology"
},
"zone": {
"$ref": "#/definitions/DateTimeZone"
},
"millis": {
"type": "integer"
},
"afterNow": {
"type": "boolean"
},
"beforeNow": {
"type": "boolean"
},
"equalNow": {
"type": "boolean"
}
},
"required": ["millisOfDay", "monthOfYear", "hourOfDay", "minuteOfHour", "secondOfMinute", "millisOfSecond", "weekOfWeekyear", "weekyear", "yearOfEra", "yearOfCentury", "centuryOfEra", "secondOfDay", "minuteOfDay", "year", "dayOfMonth", "dayOfWeek", "era", "dayOfYear", "millis", "afterNow", "beforeNow", "equalNow"]
},
"Chronology": {
"type": "object",
"additionalProperties": false,
"properties": {
"zone": {
"$ref": "#/definitions/DateTimeZone"
}
}
},
"DateTimeZone": {
"type": "object",
"additionalProperties": false,
"properties": {
"id": {
"type": "string"
},
"fixed": {
"type": "boolean"
}
},
"required": ["fixed"]
}
}
from mbknor-jackson-jsonschema.
from mbknor-jackson-jsonschema.
You are right, works well now. I forgot to add that line. Thanks again.
from mbknor-jackson-jsonschema.
Related Issues (20)
- Any way to ignore @Deprecated fields when generating schema?
- @JsonProperty(defaultValue="...") does not allow float/double values HOT 1
- Support generating multiple files instead of nesting in definitions
- Rewrite in Java, drop Scala dependencies HOT 2
- anyOf not working with array and nullableJsonSchemaDraft4
- CVE dependancies security breaches (Kotlin, jackson databind)
- Support for generating a file per class
- Proper handling of Polymorphic types when JsonTypeInfo.Id is DEDUCTION
- Support for restrictions in local definitions instead of in-lined HOT 1
- JaxbAnnotationModule and PropertyNamingStrategy conflicts HOT 1
- Generation throws java.lang.NoClassDefFoundError: javax/validation/constraints/NotBlank HOT 1
- How to document type properties used for polymorphism?
- A way to use jakarta.validation instead of javax.validation
- Security Vulnerability: Latest 1.0.39 release depends on version of Scala with known vulernability HOT 1
- Security Vulnerability: Latest 1.0.39 release depends on version of Jackson with known vulnerabilites
- Security Vulnerability: Latest 1.0.39 release depends on version of Kotlin with known vulnerabilities
- Question: Custom Type Mapping with Java
- Calling `JsonSchemaConfig.builder()` scans the entire classpath
- support Scala 3
- Schema generation for JsonSchemaExamples on double valued field throws an exception HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mbknor-jackson-jsonschema.