-
Notifications
You must be signed in to change notification settings - Fork 1
Conversation
@angoglez it seems this has problems with the scalafmt format and compilation errors. Could you please re-format it with |
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.
Left a comment, besides that the other changes look good to me.
@@ -1,4 +1,4 @@ | |||
CREATE TYPE idl AS ENUM ('avro', 'protobuf', 'mu', 'openapi', 'scala'); | |||
CREATE TYPE idl AS ENUM ('avro', 'protobuf', 'mu', 'openapiyaml', 'openapijson', 'scala'); |
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.
We shouldn't change migrations. If we need a change we need to create a new migration file. The idea with the migrations is to manage DB evolutions and changing a previous one makes for an existing installation would make it fail.
I think this post covers what we need here, specially in the Updating/Renaming a Value
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.
The PgStorageSpec
should tell you if everything went well. Indeed it detected a missing ;
https://github.com/higherkindness/compendium/pull/302/checks?check_run_id=869965122#step:7:94
src/main/resources/db/migration/metadata/V2__update_idl_types.sql
Outdated
Show resolved
Hide resolved
val stream: InputStream = getClass.getResourceAsStream("/wrongYamlOpenAPI.yaml") | ||
val text: String = scala.io.Source.fromInputStream(stream).getLines.mkString("\n") | ||
val protocol: Protocol = Protocol(text) | ||
stream.close() |
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.
suggestion: use Resource.
It doesn't need to be part of this PR :)
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.
Good idea!, but as you said I'd address it in a following PR
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.
Sure, thanks @juanpedromoreno! We'll have this in mind.
src/main/resources/db/migration/metadata/V2__update_idl_types.sql
Outdated
Show resolved
Hide resolved
Co-authored-by: Fede Fernández <[email protected]>
Description
Related issue (marlow): https://github.com/47deg/marlow/issues/636
Related issue (compendium): #30
This PR adds compendiun OpenAPI support (using YAML or JSON files)
Found issues
openapiyaml
but you insert as raw a correct OpenAPI JSON, validation step it's done correctly and the schema it's stored. This has something to do with Skeumorph, thought it provides different parsers for each type of file. I think this can lead to inconsistency but I don't have ideas about how to prevent it. It doesn't happen the other way round. (See Unexpected behavior? - OpenAPIParser skeuomorph#303)