-
Notifications
You must be signed in to change notification settings - Fork 4
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
Enable Dynamic Schema Support for File Type Definitions in Analysis Types #858
Conversation
song-core/src/main/java/bio/overture/song/core/model/Options.java
Outdated
Show resolved
Hide resolved
song-server/src/main/java/bio/overture/song/server/model/entity/AnalysisSchema.java
Outdated
Show resolved
Hide resolved
song-server/src/main/resources/db/migration/V1__Base_version.sql
Outdated
Show resolved
Hide resolved
song-server/src/main/java/bio/overture/song/server/service/AnalysisTypeService.java
Outdated
Show resolved
Hide resolved
song-server/src/main/java/bio/overture/song/server/service/AnalysisTypeService.java
Outdated
Show resolved
Hide resolved
song-server/src/main/java/bio/overture/song/server/service/AnalysisTypeService.java
Outdated
Show resolved
Hide resolved
song-server/src/main/java/bio/overture/song/server/service/AnalysisTypeService.java
Outdated
Show resolved
Hide resolved
song-server/src/main/java/bio/overture/song/server/service/AnalysisTypeService.java
Outdated
Show resolved
Hide resolved
song-server/src/main/java/bio/overture/song/server/service/ValidationService.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks complete, just two small nitpicks.
Can you add a comment to this PR that describes the behaviour when we are creating a new version of an existing schema - if you don't specify file types does it keep the existing file type restrictions or remove the existing restrictions? We can create another ticket to update this behaviour if it is unintuitive, I just want to record what the behaviour is.
.fileTypes(fileTypes) | ||
.build(); | ||
|
||
log.info("file types " + fileTypes); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like developer test logs, I think we can remove this or change it to debug level and add more details from the analysis schema that is being created.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@@ -849,7 +850,7 @@ public static List<AnalysisType> generateData( | |||
i -> { | |||
val name = names.get(i % repeats); | |||
val schema = generateRandomRegistrationPayload(randomGenerator); | |||
val out = analysisTypeService.register(name, schema); | |||
val out = analysisTypeService.register(name,new AnalysisTypeOptions(), schema); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like code formatting hasn't been run on this line, no space between comma and next argument.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good!
Base Schema Updates:
fileType
is now its own definition, allowing any string value.file.fileType
references this new definition, ensuring that it is always a required property for files.Analysis Type Registration Schema:
file.fileType
definition, it merges with the base schema definition.file.fileType
within the dynamic schema.Data Structure Enhancements:
options.fileTypes
array in theanalysisType
dynamic schema, allowing users to define specific allowed file types.analysisTypeService.register
to accept theoptions
object.Validation Enforcement:
fileTypes
from the schema, in addition to JSON Schema validation.Notes:
Impact:
This change provides a more flexible and dynamic way to handle file type validations for various analysis types, paving the way for future enhancements and custom analysis schemas.