-
Notifications
You must be signed in to change notification settings - Fork 610
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
controllers/krate/metadata: Add support for
default_version
include…
… mode (#10288) This allows us to respond with a version data of `default_version` included, which potentially benefits apps by eliminating the need to wait for the crate response to obtain the default version and then make a subsequent request to get the actual version data. This is particularly useful when we move towards not requesting with `versions` included.
- Loading branch information
Showing
4 changed files
with
143 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
79 changes: 79 additions & 0 deletions
79
...tes/crates/snapshots/crates_io__tests__routes__crates__read__include_default_version.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
--- | ||
source: src/tests/routes/crates/read.rs | ||
expression: response.json() | ||
snapshot_kind: text | ||
--- | ||
{ | ||
"categories": null, | ||
"crate": { | ||
"badges": [], | ||
"categories": null, | ||
"created_at": "[datetime]", | ||
"default_version": "0.5.1", | ||
"description": "description", | ||
"documentation": "https://example.com", | ||
"downloads": 20, | ||
"exact_match": false, | ||
"homepage": "http://example.com", | ||
"id": "foo_default_version", | ||
"keywords": null, | ||
"links": { | ||
"owner_team": "/api/v1/crates/foo_default_version/owner_team", | ||
"owner_user": "/api/v1/crates/foo_default_version/owner_user", | ||
"owners": "/api/v1/crates/foo_default_version/owners", | ||
"reverse_dependencies": "/api/v1/crates/foo_default_version/reverse_dependencies", | ||
"version_downloads": "/api/v1/crates/foo_default_version/downloads", | ||
"versions": "/api/v1/crates/foo_default_version/versions" | ||
}, | ||
"max_stable_version": null, | ||
"max_version": "0.0.0", | ||
"name": "foo_default_version", | ||
"newest_version": "0.0.0", | ||
"recent_downloads": null, | ||
"repository": null, | ||
"updated_at": "[datetime]", | ||
"versions": null, | ||
"yanked": false | ||
}, | ||
"keywords": null, | ||
"versions": [ | ||
{ | ||
"audit_actions": [], | ||
"bin_names": null, | ||
"checksum": " ", | ||
"crate": "foo_default_version", | ||
"crate_size": 0, | ||
"created_at": "[datetime]", | ||
"description": null, | ||
"dl_path": "/api/v1/crates/foo_default_version/0.5.1/download", | ||
"documentation": null, | ||
"downloads": 0, | ||
"edition": null, | ||
"features": {}, | ||
"has_lib": null, | ||
"homepage": null, | ||
"id": 3, | ||
"lib_links": null, | ||
"license": null, | ||
"links": { | ||
"authors": "/api/v1/crates/foo_default_version/0.5.1/authors", | ||
"dependencies": "/api/v1/crates/foo_default_version/0.5.1/dependencies", | ||
"version_downloads": "/api/v1/crates/foo_default_version/0.5.1/downloads" | ||
}, | ||
"num": "0.5.1", | ||
"published_by": { | ||
"avatar": null, | ||
"id": 1, | ||
"login": "foo", | ||
"name": null, | ||
"url": "https://github.com/foo" | ||
}, | ||
"readme_path": "/api/v1/crates/foo_default_version/0.5.1/readme", | ||
"repository": null, | ||
"rust_version": null, | ||
"updated_at": "[datetime]", | ||
"yank_message": null, | ||
"yanked": false | ||
} | ||
] | ||
} |