Closed InfoSec812 closed 4 years ago
Also, something like x-jpa-additional-imports
as an array? Something like:
components:
schemas:
EventBase:
title: Root Type for Event
description: The root of the Event type's schema.
x-jpa-table-name: events
x-jpa-additional-imports:
- javax.persistence.GeneratedValue
- javax.persistence.GenerationType
- javax.persistence.Embeddable
- javax.persistence.MappedSuperclass
- javax.persistence.Enumerated
required:
- eventType
- id
- name
- startTime
- endTime
type: object
Looping in @haithamshahin333
And also, to improve flexibility and extensibility, on the field definitions we could do:
properties:
eventType:
type: string
name:
type: string
id:
format: uuid
type: string
uniqueItems: true
x-jpa-annotations:
- @Id
- @GeneratedValue(strategy = GeneratedValue.SEQUENCE, generator = "events_seq")
- @Column(name = "event_id")
sounds good
Proposed extension on #5312
The more I dig into this, the more I am convinced that this needs to be a broader effort which modernizes/updates all of the Java based generators, including JAX-RS. I'm going to close this issue and consider doing some work toward that end.
Is your feature request related to a problem? Please describe.
x-jpa-table-name
x-jpa-id
x-jpa-transient
x-jpa-column-name
x-jpa-additional-annotations
springDataJpa
as a booleanDescribe the solution you'd like
I will be submitting a PR with the appropriate changes, but in general, parsing something like this in an object definition
Into something like this:
Describe alternatives you've considered
I have considered using a post-processor script, but it is not as reliable in a CI/CD environment and could be difficult to make cross-platform.