This PR is not compatible with previous code... Rename some Annotation to have a better experience Update the generation of the Typescript object =================================== By default the generation of object are only the object requested if you annotate the object with: `@ApiGenerationMode(create = true, update = true)` the generation will add 2 object in typescript: - `MyClassUpdate` that contain the object specific for `PUT` request - `MyClassCreate` that contain the object specific for `POST` request - the PATCH request are generate with `Partial<MyClassUpdate>` If you do not generate the create or update the system will wrap the bass by default: `MyClass` Add support of hidding the element in the generated object ============================================= When generate the object some field are not needed to transmit to the client, then we add `@ApiAccessLimitation(creatable = false, updatable = false)` that permit to remove the field when Update or Create object are generated It will be used to check the Input validity instead of `@schema(readonly)` (error of implementation) TODO: ===== - Some issue when request Update generation and parent does not exist - The checker is not updated with the use of the `@ApiAccessLimitation` decorator. dependencies: =========== - Closes: https://github.com/kangaroo-and-rabbit/archidata/issues/22
24 lines
772 B
Java
24 lines
772 B
Java
package org.kar.archidata.model;
|
|
|
|
import org.kar.archidata.annotation.DataDeleted;
|
|
import org.kar.archidata.annotation.DataNotRead;
|
|
import org.kar.archidata.annotation.apiGenerator.ApiAccessLimitation;
|
|
import org.kar.archidata.annotation.apiGenerator.ApiGenerationMode;
|
|
|
|
import io.swagger.v3.oas.annotations.media.Schema;
|
|
import jakarta.annotation.Nullable;
|
|
import jakarta.persistence.Column;
|
|
import jakarta.ws.rs.DefaultValue;
|
|
|
|
@ApiGenerationMode(create = true, update = true)
|
|
public class GenericDataSoftDelete extends GenericData {
|
|
@DataNotRead
|
|
@Column(nullable = false)
|
|
@DefaultValue("'0'")
|
|
@DataDeleted
|
|
@Schema(description = "Deleted state", hidden = true)
|
|
@Nullable
|
|
@ApiAccessLimitation(creatable = false, updatable = false)
|
|
public Boolean deleted = null;
|
|
}
|