Backend API updated to indicate nullable fields
This commit is contained in:
1 parent
e32e270db0
commit
af7880ceac
3 files changed
+10
-10
No files matched your search
+1
-1
@@ -21,4 +21,4 @@
|
|||||||
// @description From GET /api/csrf; send its cookie too.
|
// @description From GET /api/csrf; send its cookie too.
|
||||||
package api
|
package api
|
||||||
|
|
||||||
//go:generate swag init --v3.1 --generalInfo doc.go --dir . --parseInternal --parseDependencyLevel 1 --outputTypes json --output openapi
|
//go:generate swag init --v3.1 --generalInfo doc.go --dir . --parseInternal --parseDependencyLevel 1 --requiredByDefault --outputTypes json --output openapi
|
||||||
@@ -8,12 +8,12 @@ import (
|
|||||||
|
|
||||||
// Problem is an RFC 9457 problem details body.
|
// Problem is an RFC 9457 problem details body.
|
||||||
type Problem struct {
|
type Problem struct {
|
||||||
Type string `json:"type,omitempty"`
|
Type string `json:"type,omitempty" validate:"optional"`
|
||||||
Status int `json:"status"`
|
Status int `json:"status"`
|
||||||
Title string `json:"title"`
|
Title string `json:"title"`
|
||||||
Detail string `json:"detail,omitempty"`
|
Detail string `json:"detail,omitempty" validate:"optional"`
|
||||||
Instance string `json:"instance,omitempty"`
|
Instance string `json:"instance,omitempty" validate:"optional"`
|
||||||
RequestID string `json:"requestId,omitempty"`
|
RequestID string `json:"requestId,omitempty" validate:"optional"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// WriteProblem writes a problem+json error response.
|
// WriteProblem writes a problem+json error response.
|
||||||
|
|||||||
@@ -20,20 +20,20 @@ type Opportunity struct {
|
|||||||
Status string `db:"status" json:"status"`
|
Status string `db:"status" json:"status"`
|
||||||
Description string `db:"description" json:"description"`
|
Description string `db:"description" json:"description"`
|
||||||
BuyerName string `db:"buyer_name" json:"buyer_name"`
|
BuyerName string `db:"buyer_name" json:"buyer_name"`
|
||||||
Classifications []ClassificationCode `db:"-" json:"classifications"`
|
Classifications []ClassificationCode `db:"-" json:"classifications" extensions:"x-nullable"`
|
||||||
BuyerID string `db:"buyer_id" json:"buyer_id"`
|
BuyerID string `db:"buyer_id" json:"buyer_id"`
|
||||||
MainCategory string `db:"main_category" json:"main_category"`
|
MainCategory string `db:"main_category" json:"main_category"`
|
||||||
ProcurementMethod string `db:"procurement_method" json:"procurement_method"`
|
ProcurementMethod string `db:"procurement_method" json:"procurement_method"`
|
||||||
MultiLot bool `db:"multi_lot" json:"multi_lot"`
|
MultiLot bool `db:"multi_lot" json:"multi_lot"`
|
||||||
SMESuitable bool `db:"sme_suitable" json:"sme_suitable"`
|
SMESuitable bool `db:"sme_suitable" json:"sme_suitable"`
|
||||||
VCSESuitable bool `db:"vcse_suitable" json:"vcse_suitable"`
|
VCSESuitable bool `db:"vcse_suitable" json:"vcse_suitable"`
|
||||||
StartDate *time.Time `db:"start_date" json:"start_date"`
|
StartDate *time.Time `db:"start_date" json:"start_date" extensions:"x-nullable"`
|
||||||
EndDate *time.Time `db:"end_date" json:"end_date"`
|
EndDate *time.Time `db:"end_date" json:"end_date" extensions:"x-nullable"`
|
||||||
GrossValue float64 `db:"gross_value" json:"gross_value"`
|
GrossValue float64 `db:"gross_value" json:"gross_value"`
|
||||||
HasDocuments bool `db:"has_documents" json:"has_documents"`
|
HasDocuments bool `db:"has_documents" json:"has_documents"`
|
||||||
Source string `db:"source" json:"source"`
|
Source string `db:"source" json:"source"`
|
||||||
LatestReleaseDate time.Time `db:"latest_release_date" json:"latest_release_date"`
|
LatestReleaseDate time.Time `db:"latest_release_date" json:"latest_release_date"`
|
||||||
Releases []OpportunityRelease `db:"-" json:"releases"`
|
Releases []OpportunityRelease `db:"-" json:"releases" extensions:"x-nullable"`
|
||||||
Marks OpportunityMarks `db:"-" json:"marks"`
|
Marks OpportunityMarks `db:"-" json:"marks"`
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -43,7 +43,7 @@ type OpportunityRelease struct {
|
|||||||
UUID string `db:"uuid" json:"uuid"`
|
UUID string `db:"uuid" json:"uuid"`
|
||||||
ReleaseID string `db:"release_id" json:"release_id"`
|
ReleaseID string `db:"release_id" json:"release_id"`
|
||||||
ReleaseDate time.Time `db:"release_date" json:"release_date"`
|
ReleaseDate time.Time `db:"release_date" json:"release_date"`
|
||||||
Tags []OpportunityReleaseTag `db:"-" json:"release_tags"`
|
Tags []OpportunityReleaseTag `db:"-" json:"release_tags" extensions:"x-nullable"`
|
||||||
JSON string `db:"data" json:"data"`
|
JSON string `db:"data" json:"data"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user