Skip to content

Commit f7abdea

Browse files
committed
[dbsp_adapters] Fix openapi generation
Signed-off-by: Karakatiza666 <bulakh.96@gmail.com>
1 parent f677acb commit f7abdea

File tree

4 files changed

+10
-13
lines changed

4 files changed

+10
-13
lines changed

crates/adapters/src/samply.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -311,8 +311,6 @@ pub(crate) enum SamplyStatus {
311311
pub(crate) struct SamplyState {
312312
pub(crate) last_profile: SamplyProfile,
313313
pub(crate) samply_status: SamplyStatus,
314-
/// Cached result of profiling availability check (None = not checked yet)
315-
profiling_available: Option<bool>,
316314
}
317315

318316
impl SamplyState {

crates/feldera-types/src/query_params.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,9 @@ fn default_samply_profile_duration() -> u64 {
5555

5656
/// Query parameters to retrieve samply profile.
5757
#[derive(Debug, Deserialize, IntoParams, ToSchema)]
58+
#[into_params(parameter_in = Query)]
5859
pub struct SamplyProfileGetParams {
59-
/// If true, returns 307 redirect if profile collection is in progress.
60+
/// If true, returns 204 redirect with Retry-After header if profile collection is in progress.
6061
/// If false or not provided, returns the last collected profile.
6162
#[serde(default)]
6263
pub latest: bool,

crates/pipeline-manager/src/api/endpoints/pipeline_interaction.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1225,12 +1225,13 @@ pub(crate) async fn start_samply_profile(
12251225
SamplyProfileGetParams,
12261226
),
12271227
responses(
1228+
// Note: This endpoint may also return 204 No Content with Retry-After header
1229+
// when latest=true and profiling is in progress, but progenitor can only handle
1230+
// one success response type, so it's not documented here.
12281231
(status = OK
1229-
, description = "Samply profile as a gzip containing the profile that can be inspected by the samply tool"
1232+
, description = "Samply profile as a gzip containing the profile that can be inspected by the samply tool. Note: may return 204 No Content with Retry-After header if latest=true and profiling is in progress."
12301233
, content_type = "application/gzip"
12311234
, body = Vec<u8>),
1232-
(status = NO_CONTENT
1233-
, description = "Samply profile collection is in progress. Check the Retry-After header for expected completion time."),
12341235
(status = NOT_FOUND
12351236
, description = "Pipeline with that name does not exist"
12361237
, body = ErrorResponse

openapi.json

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4266,17 +4266,17 @@
42664266
},
42674267
{
42684268
"name": "latest",
4269-
"in": "path",
4270-
"description": "If true, returns 307 redirect if profile collection is in progress.\nIf false or not provided, returns the last collected profile.",
4271-
"required": true,
4269+
"in": "query",
4270+
"description": "If true, returns 204 redirect with Retry-After header if profile collection is in progress.\nIf false or not provided, returns the last collected profile.",
4271+
"required": false,
42724272
"schema": {
42734273
"type": "boolean"
42744274
}
42754275
}
42764276
],
42774277
"responses": {
42784278
"200": {
4279-
"description": "Samply profile as a gzip containing the profile that can be inspected by the samply tool",
4279+
"description": "Samply profile as a gzip containing the profile that can be inspected by the samply tool. Note: may return 204 No Content with Retry-After header if latest=true and profiling is in progress.",
42804280
"content": {
42814281
"application/gzip": {
42824282
"schema": {
@@ -4286,9 +4286,6 @@
42864286
}
42874287
}
42884288
},
4289-
"204": {
4290-
"description": "Samply profile collection is in progress. Check the Retry-After header for expected completion time."
4291-
},
42924289
"400": {
42934290
"description": "No samply profile exists for the pipeline, create one by calling `POST /pipelines/{pipeline_name}/samply_profile?duration_secs=30`",
42944291
"content": {

0 commit comments

Comments
 (0)