Skip to content

Commit

Permalink
Add backward compatible fields for timestamps in schemas
Browse files Browse the repository at this point in the history
  • Loading branch information
CDimonaco committed Feb 26, 2024
1 parent 9cfe171 commit 66d53b6
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 8 deletions.
4 changes: 3 additions & 1 deletion lib/trento_web/openapi/v1/schema/cluster.ex
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,9 @@ defmodule TrentoWeb.OpenApi.V1.Schema.Cluster do
nullable: true
},
details: Details,
tags: Tags
tags: Tags,
inserted_at: %Schema{type: :string, format: :datetime},
updated_at: %Schema{type: :string, format: :datetime, nullable: true}
}
})
end
Expand Down
8 changes: 6 additions & 2 deletions lib/trento_web/openapi/v1/schema/database.ex
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ defmodule TrentoWeb.OpenApi.V1.Schema.Database do
type: :string,
description: "System Replication Status"
},
health: ResourceHealth
health: ResourceHealth,
inserted_at: %Schema{type: :string, format: :datetime},
updated_at: %Schema{type: :string, format: :datetime, nullable: true}
}
})
end
Expand Down Expand Up @@ -78,7 +80,9 @@ defmodule TrentoWeb.OpenApi.V1.Schema.Database do
sid: %Schema{type: :string, description: "SID"},
health: ResourceHealth,
database_instances: DatabaseInstances,
tags: Tags
tags: Tags,
inserted_at: %Schema{type: :string, format: :datetime},
updated_at: %Schema{type: :string, format: :datetime, nullable: true}
}
})
end
Expand Down
4 changes: 3 additions & 1 deletion lib/trento_web/openapi/v1/schema/host.ex
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,9 @@ defmodule TrentoWeb.OpenApi.V1.Schema.Host do
type: :string,
nullable: true,
format: :"date-time"
}
},
inserted_at: %Schema{type: :string, format: :datetime},
updated_at: %Schema{type: :string, format: :datetime, nullable: true}
}
})
end
Expand Down
8 changes: 6 additions & 2 deletions lib/trento_web/openapi/v1/schema/sap_system.ex
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ defmodule TrentoWeb.OpenApi.V1.Schema.SAPSystem do
description: "Identifier of the host where current instance is running",
format: :uuid
},
health: ResourceHealth
health: ResourceHealth,
inserted_at: %Schema{type: :string, format: :datetime},
updated_at: %Schema{type: :string, format: :datetime, nullable: true}
}
})
end
Expand Down Expand Up @@ -75,7 +77,9 @@ defmodule TrentoWeb.OpenApi.V1.Schema.SAPSystem do
items: ApplicationInstance
},
database_instances: Database.DatabaseInstances,
tags: Tags
tags: Tags,
inserted_at: %Schema{type: :string, format: :datetime},
updated_at: %Schema{type: :string, format: :datetime, nullable: true}
}
})
end
Expand Down
4 changes: 3 additions & 1 deletion lib/trento_web/openapi/v1/schema/tag.ex
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ defmodule TrentoWeb.OpenApi.V1.Schema.Tags do
id: %Schema{type: :integer},
resource_id: %Schema{type: :string, format: :uuid},
resource_type: %Schema{type: :string, enum: [:host, :cluster, :sap_system, :database]},
value: %Schema{type: :string}
value: %Schema{type: :string},
inserted_at: %Schema{type: :string, format: :datetime},
updated_at: %Schema{type: :string, format: :datetime, nullable: true}
}
})
end
Expand Down
4 changes: 3 additions & 1 deletion lib/trento_web/openapi/v2/schema/cluster.ex
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,9 @@ defmodule TrentoWeb.OpenApi.V2.Schema.Cluster do
nullable: true
},
details: Details,
tags: Tags
tags: Tags,
inserted_at: %Schema{type: :string, format: :datetime},
updated_at: %Schema{type: :string, format: :datetime, nullable: true}
}
})
end
Expand Down

0 comments on commit 66d53b6

Please sign in to comment.