Skip to content
This repository has been archived by the owner on Mar 14, 2022. It is now read-only.

Repair swagger #76

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 0 additions & 55 deletions generated/models/deposit_new_resource_okbody.go

This file was deleted.

3 changes: 3 additions & 0 deletions generated/models/resource.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion generated/restapi/doc.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 6 additions & 16 deletions generated/restapi/embedded_spec.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion handlers/deposit_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ func (d *depositResourceEntry) Handle(params operations.DepositNewResourceParams
// TODO: This should be a DRUID
resourceID, _ := uuid.NewRandom()

response := &models.DepositNewResourceOKBody{RequestID: requestID.String(), State: "deposited", ID: resourceID.String()}
response := &models.Resource{RequestID: requestID.String(), ID: resourceID.String()}
return operations.NewDepositNewResourceOK().WithPayload(response)
}
22 changes: 6 additions & 16 deletions swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"swagger" : "2.0",
"info" : {
"description" : "TACO, the Stanford Digital Repository (SDR) Management Layer interface",
"version" : "0.0.1",
"version" : "0.0.2",
"title" : "taco",
"license" : {
"name" : "Apache 2.0",
Expand Down Expand Up @@ -33,21 +33,7 @@
"200" : {
"description" : "Success response",
"schema" : {
"type" : "object",
"properties" : {
"id" : {
"type" : "string",
"example" : "oo000oo0001"
},
"state" : {
"type" : "string",
"example" : "in progress"
},
"request_id" : {
"type" : "string",
"example" : "0a72c00a-1332-4730-b19c-9131c3bcb57f"
}
}
"$ref" : "#/definitions/Resource"
Copy link
Contributor

@jcoyne jcoyne Jan 26, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't agree that this is the correct response for a create. As documented on the whiteboard the response should be a RequestID, a ResourceID and a RequestStatus. I don't think it makes sense to send them back the resource they just sent us. See #44

}
},
"405" : {
Expand Down Expand Up @@ -160,6 +146,10 @@
"sourceId" : {
"type" : "string",
"example" : "bib12345678"
},
"request_id" : {
"type" : "string",
"example" : "0a72c00a-1332-4730-b19c-9131c3bcb57f"
}
},
"example" : {
Expand Down