Skip to content

Commit

Permalink
swagger file updated, error handling updated
Browse files Browse the repository at this point in the history
  • Loading branch information
BarathaAberathne committed Jan 24, 2025
1 parent 85a5b0b commit 19dbd02
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion api/dataset.go
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,7 @@ func (api *DatasetAPI) addDatasetVersionCondensed(w http.ResponseWriter, r *http
newInstance, err := instance.UnmarshalInstance(ctx, r.Body, true)
if err != nil {
log.Error(ctx, "failed to unmarshal instance", err, logData)
handleDatasetAPIErr(ctx, errs.ErrInvalidQueryParameter, w, nil)
handleDatasetAPIErr(ctx, errs.ErrInvalidBody, w, nil)
return
}

Expand Down
2 changes: 1 addition & 1 deletion api/dataset_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1754,6 +1754,6 @@ func TestAddDatasetVersionCondensed(t *testing.T) {
api := GetAPIWithCMDMocks(mockedDataStore, &mocks.DownloadsGeneratorMock{}, datasetPermissions, permissions)
api.addDatasetVersionCondensed(w, r)

convey.So(w.Code, convey.ShouldEqual, http.StatusBadRequest)
convey.So(w.Code, convey.ShouldEqual, http.StatusInternalServerError)
})
}
11 changes: 11 additions & 0 deletions swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2535,6 +2535,8 @@ definitions:
$ref: '#/definitions/SelfLink'
spatial:
$ref: '#/definitions/SpatialLink'
job:
$ref: '#/definitions/JobLink'
DatasetLink:
description: "An object containing the dataset id and link"
readOnly: true
Expand Down Expand Up @@ -2599,6 +2601,15 @@ definitions:
href:
description: "A url to a list of geography ranges for the version of the dataset"
type: string
JobLink:
type: object
properties:
href:
description: "A URL to list dimensions for this version"
type: string
id:
description: "A Job id"
type: string
TaxonomyLink:
description: "A link to the taxonomy of the dataset"
type: object
Expand Down

0 comments on commit 19dbd02

Please sign in to comment.