Skip to content

Commit

Permalink
api: Remove body from Unclaim request
Browse files Browse the repository at this point in the history
  • Loading branch information
KrishnaIyer committed Jul 6, 2023
1 parent 9219ac1 commit a96be30
Show file tree
Hide file tree
Showing 8 changed files with 119 additions and 128 deletions.
2 changes: 1 addition & 1 deletion api/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -2863,7 +2863,7 @@ and allows clients to claim end devices.
| Method Name | Method | Pattern | Body |
| ----------- | ------ | ------- | ---- |
| `Claim` | `POST` | `/api/v3/edcs/claim` | `*` |
| `Unclaim` | `DELETE` | `/api/v3/edcs/claim/{application_ids.application_id}/devices/{device_id}` | `*` |
| `Unclaim` | `DELETE` | `/api/v3/edcs/claim/{application_ids.application_id}/devices/{device_id}` | |
| `GetInfoByJoinEUI` | `POST` | `/api/v3/edcs/claim/info` | `*` |
| `GetClaimStatus` | `GET` | `/api/v3/edcs/claim/{application_ids.application_id}/devices/{device_id}` | |
| `AuthorizeApplication` | `POST` | `/api/v3/edcs/applications/{application_ids.application_id}/authorize` | `*` |
Expand Down
51 changes: 22 additions & 29 deletions api/api.swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -7974,35 +7974,28 @@
"type": "string"
},
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"type": "object",
"properties": {
"application_ids": {
"type": "object"
},
"dev_eui": {
"type": "string",
"format": "string",
"example": "70B3D57ED000ABCD",
"description": "The LoRaWAN DevEUI."
},
"join_eui": {
"type": "string",
"format": "string",
"example": "70B3D57ED000ABCD",
"description": "The LoRaWAN JoinEUI (AppEUI until LoRaWAN 1.0.3 end devices)."
},
"dev_addr": {
"type": "string",
"format": "string",
"example": "2600ABCD",
"description": "The LoRaWAN DevAddr."
}
}
}
"name": "dev_eui",
"description": "The LoRaWAN DevEUI.",
"in": "query",
"required": false,
"type": "string",
"format": "string"
},
{
"name": "join_eui",
"description": "The LoRaWAN JoinEUI (AppEUI until LoRaWAN 1.0.3 end devices).",
"in": "query",
"required": false,
"type": "string",
"format": "string"
},
{
"name": "dev_addr",
"description": "The LoRaWAN DevAddr.",
"in": "query",
"required": false,
"type": "string",
"format": "string"
}
],
"tags": [
Expand Down
1 change: 0 additions & 1 deletion api/deviceclaimingserver.proto
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,6 @@ service EndDeviceClaimingServer {
rpc Unclaim(EndDeviceIdentifiers) returns (google.protobuf.Empty) {
option (google.api.http) = {
delete: "/edcs/claim/{application_ids.application_id}/devices/{device_id}",
body: "*"
};
};

Expand Down
152 changes: 76 additions & 76 deletions pkg/ttnpb/deviceclaimingserver.pb.go

Large diffs are not rendered by default.

34 changes: 18 additions & 16 deletions pkg/ttnpb/deviceclaimingserver.pb.gw.go

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

1 change: 0 additions & 1 deletion sdk/js/generated/api-definition.json
Original file line number Diff line number Diff line change
Expand Up @@ -2267,7 +2267,6 @@
{
"method": "delete",
"pattern": "/edcs/claim/{application_ids.application_id}/devices/{device_id}",
"body": "*",
"parameters": [
"application_ids.application_id",
"device_id"
Expand Down
3 changes: 1 addition & 2 deletions sdk/js/generated/api.json
Original file line number Diff line number Diff line change
Expand Up @@ -11101,8 +11101,7 @@
"rules": [
{
"method": "DELETE",
"pattern": "/edcs/claim/{application_ids.application_id}/devices/{device_id}",
"body": "*"
"pattern": "/edcs/claim/{application_ids.application_id}/devices/{device_id}"
}
]
}
Expand Down
3 changes: 1 addition & 2 deletions tools/mage/proto.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ func (p Proto) fieldMask(context.Context) error {
func (p Proto) grpcGateway(context.Context) error {
return withProtoc(grpcGatewayProtoImage, func(pCtx *protocContext, protoc func(...string) error) error {
if err := protoc(
fmt.Sprintf("--grpc-gateway_out=allow_delete_body=true:%s", protocOut),
fmt.Sprintf("--grpc-gateway_out=:%s", protocOut),
fmt.Sprintf("%s/api/*.proto", pCtx.WorkingDirectory),
); err != nil {
return fmt.Errorf("failed to generate protos: %w", err)
Expand Down Expand Up @@ -204,7 +204,6 @@ func (p Proto) Swagger(context.Context) error {
}
return withProtoc(openAPIv2ProtoImage, func(pCtx *protocContext, protoc func(...string) error) error {
if err := protoc(
"--openapiv2_opt allow_delete_body=true",
"--openapiv2_opt=json_names_for_fields=false",
fmt.Sprintf("--openapiv2_out=allow_merge,merge_file_name=api:%s/api", pCtx.WorkingDirectory),
fmt.Sprintf("%s/api/*.proto", pCtx.WorkingDirectory),
Expand Down

0 comments on commit a96be30

Please sign in to comment.