Skip to content

Commit

Permalink
fix: kubo rpc alignment
Browse files Browse the repository at this point in the history
  • Loading branch information
smrz2001 committed Oct 11, 2023
1 parent 16a50d8 commit 730fa85
Show file tree
Hide file tree
Showing 10 changed files with 132 additions and 250 deletions.
12 changes: 6 additions & 6 deletions kubo-rpc-server.patch
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ index 19eff91..f78219b 100644
400 => {
let body = response.into_body();
diff --git b/kubo-rpc-server/src/lib.rs a/kubo-rpc-server/src/lib.rs
index a438acd..68c986c 100644
index 4fb7cb1..bd4e190 100644
--- b/kubo-rpc-server/src/lib.rs
+++ a/kubo-rpc-server/src/lib.rs
@@ -11,7 +11,8 @@
Expand Down Expand Up @@ -69,10 +69,10 @@ index a438acd..68c986c 100644
#[must_use]
pub enum SwarmConnectPostResponse {
diff --git b/kubo-rpc-server/src/models.rs a/kubo-rpc-server/src/models.rs
index 20d075b..7a6d6b8 100644
index 4644ce0..ce429ca 100644
--- b/kubo-rpc-server/src/models.rs
+++ a/kubo-rpc-server/src/models.rs
@@ -1037,7 +1037,7 @@ pub struct Error {
@@ -909,7 +909,7 @@ pub struct Error {
pub code: f64,

#[serde(rename = "Type")]
Expand All @@ -81,7 +81,7 @@ index 20d075b..7a6d6b8 100644
}

impl Error {
@@ -1046,7 +1046,7 @@ impl Error {
@@ -918,7 +918,7 @@ impl Error {
Error {
message,
code,
Expand All @@ -90,7 +90,7 @@ index 20d075b..7a6d6b8 100644
}
}
}
@@ -1062,7 +1062,7 @@ impl std::string::ToString for Error {
@@ -934,7 +934,7 @@ impl std::string::ToString for Error {
Some("Code".to_string()),
Some(self.code.to_string()),
Some("Type".to_string()),
Expand All @@ -99,7 +99,7 @@ index 20d075b..7a6d6b8 100644
];

params.into_iter().flatten().collect::<Vec<_>>().join(",")
@@ -1140,7 +1140,7 @@ impl std::str::FromStr for Error {
@@ -1012,7 +1012,7 @@ impl std::str::FromStr for Error {
.into_iter()
.next()
.ok_or_else(|| "Code missing in Error".to_string())?,
Expand Down
3 changes: 1 addition & 2 deletions kubo-rpc-server/.openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ api/openapi.yaml
docs/BlockPutPost200Response.md
docs/Codecs.md
docs/DagImportPost200Response.md
docs/DagImportPost200ResponseRoot.md
docs/DagImportPost200ResponseRootCid.md
docs/DagPutPost200Response.md
docs/DagPutPost200ResponseCid.md
docs/DagResolvePost200Response.md
docs/DagResolvePost200ResponseCid.md
docs/Error.md
Expand Down
5 changes: 2 additions & 3 deletions kubo-rpc-server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ To see how to make this your own, look here:
[README]((https://openapi-generator.tech))

- API version: 0.1.1
- Build date: 2023-09-18T11:40:30.151-06:00[America/Denver]
- Build date: 2023-09-26T22:40:03.737-06:00[America/Mexico_City]



Expand Down Expand Up @@ -134,9 +134,8 @@ Method | HTTP request | Description
- [BlockPutPost200Response](docs/BlockPutPost200Response.md)
- [Codecs](docs/Codecs.md)
- [DagImportPost200Response](docs/DagImportPost200Response.md)
- [DagImportPost200ResponseRoot](docs/DagImportPost200ResponseRoot.md)
- [DagImportPost200ResponseRootCid](docs/DagImportPost200ResponseRootCid.md)
- [DagPutPost200Response](docs/DagPutPost200Response.md)
- [DagPutPost200ResponseCid](docs/DagPutPost200ResponseCid.md)
- [DagResolvePost200Response](docs/DagResolvePost200Response.md)
- [DagResolvePost200ResponseCid](docs/DagResolvePost200ResponseCid.md)
- [Error](docs/Error.md)
Expand Down
25 changes: 8 additions & 17 deletions kubo-rpc-server/api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -449,14 +449,14 @@ components:
schemas:
Codecs:
enum:
- dag_json
- dag_cbor
- dag_jose
- dag-json
- dag-cbor
- dag-jose
- raw
type: string
Multihash:
enum:
- sha2_256
- sha2-256
type: string
Error:
properties:
Expand All @@ -479,16 +479,7 @@ components:
required:
- file
type: object
_dag_put_post_200_response:
example:
Cid: Cid
properties:
Cid:
type: string
required:
- Cid
type: object
_dag_import_post_200_response_Root_Cid:
_dag_put_post_200_response_Cid:
example:
/: /
properties:
Expand All @@ -497,13 +488,13 @@ components:
required:
- /
type: object
_dag_import_post_200_response_Root:
_dag_put_post_200_response:
example:
Cid:
/: /
properties:
Cid:
$ref: '#/components/schemas/_dag_import_post_200_response_Root_Cid'
$ref: '#/components/schemas/_dag_put_post_200_response_Cid'
required:
- Cid
type: object
Expand All @@ -514,7 +505,7 @@ components:
/: /
properties:
Root:
$ref: '#/components/schemas/_dag_import_post_200_response_Root'
$ref: '#/components/schemas/_dag_put_post_200_response'
required:
- Root
type: object
Expand Down
2 changes: 1 addition & 1 deletion kubo-rpc-server/docs/DagImportPost200Response.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**root** | [***models::DagImportPost200ResponseRoot**](_dag_import_post_200_response_Root.md) | |
**root** | [***models::DagPutPost200Response**](_dag_put_post_200_response.md) | |

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

Expand Down
2 changes: 1 addition & 1 deletion kubo-rpc-server/docs/DagPutPost200Response.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**cid** | **String** | |
**cid** | [***models::DagPutPost200ResponseCid**](_dag_put_post_200_response_Cid.md) | |

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

Expand Down
10 changes: 10 additions & 0 deletions kubo-rpc-server/docs/DagPutPost200ResponseCid.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# DagPutPost200ResponseCid

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**slash** | **String** | |

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


Loading

0 comments on commit 730fa85

Please sign in to comment.