Skip to content

Commit

Permalink
minor swagger fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
oskogstad committed Feb 20, 2025
1 parent a5689f2 commit 8a35403
Show file tree
Hide file tree
Showing 5 changed files with 88 additions and 5 deletions.
14 changes: 12 additions & 2 deletions docs/schema/V1/swagger.verified.json
Original file line number Diff line number Diff line change
Expand Up @@ -5230,6 +5230,16 @@
},
"403": {
"description": "Unauthorized to get the supplied dialog (not owned by authenticated organization or has additional scope requirements defined in policy)."
},
"404": {
"content": {
"application/problem\u002Bjson": {
"schema": {
"$ref": "#/components/schemas/ProblemDetails"
}
}
},
"description": "The given dialog ID was not found."
}
},
"security": [
Expand Down Expand Up @@ -5292,7 +5302,7 @@
}
}
},
"description": "The given dialog ID was not found or was deleted, or the given activity ID was not found."
"description": "The specified dialog ID or activity ID was not found."
}
},
"security": [
Expand Down Expand Up @@ -6876,7 +6886,7 @@
}
}
},
"description": "The given dialog ID was not found or was deleted, or the given activity ID was not found."
"description": "The specified dialog ID or activity ID was not found."
},
"410": {
"description": "Entity with the given key(s) is removed."
Expand Down
2 changes: 1 addition & 1 deletion src/Digdir.Domain.Dialogporten.WebApi/Common/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ internal static class SwaggerSummary
internal const string EndUserAuthenticationFailure = "Missing or invalid authentication token. Requires a Maskinporten-token with the scope \"digdir:dialogporten\".";
internal const string DialogNotFound = "The given dialog ID was not found.";
internal const string DialogDeleted = $"Entity with the given key(s) is removed.";
internal const string DialogActivityNotFound = "The given dialog ID was not found or was deleted, or the given activity ID was not found.";
internal const string DialogActivityNotFound = "The specified dialog ID or activity ID was not found.";
internal const string DialogTransmissionNotFound = "The given dialog ID was not found or was deleted, or the given transmission ID was not found.";
internal const string RevisionMismatch = "The supplied If-Match header did not match the current Revision value for the dialog. The request was not applied.";
internal const string AccessDeniedToDialog = "Unauthorized to {0} the supplied dialog (not owned by authenticated organization or has additional scope requirements defined in policy).";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using Digdir.Domain.Dialogporten.Application.Features.V1.EndUser.DialogActivities.Queries.Search;
using Digdir.Domain.Dialogporten.WebApi.Common.Authorization;
using Digdir.Domain.Dialogporten.WebApi.Common.Extensions;
using Digdir.Domain.Dialogporten.WebApi.Endpoints.V1.Common.Extensions;
using FastEndpoints;
using MediatR;

Expand All @@ -20,6 +21,10 @@ public override void Configure()
Get("dialogs/{dialogId}/activities");
Policies(AuthorizationPolicy.EndUser);
Group<EndUserGroup>();

Description(b => b.ProducesOneOf<List<ActivityDto>>(
StatusCodes.Status200OK,
StatusCodes.Status404NotFound));
}

public override async Task HandleAsync(SearchActivityQuery req, CancellationToken ct)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Gets the list of activities belonging to a dialog
Responses[StatusCodes.Status200OK] = Constants.SwaggerSummary.ReturnedResult.FormatInvariant("activity list");
Responses[StatusCodes.Status401Unauthorized] = Constants.SwaggerSummary.ServiceOwnerAuthenticationFailure.FormatInvariant(AuthorizationScope.ServiceProvider);
Responses[StatusCodes.Status403Forbidden] = Constants.SwaggerSummary.AccessDeniedToDialog.FormatInvariant("get");
Responses[StatusCodes.Status404NotFound] = Constants.SwaggerSummary.DialogNotFound;
Responses[StatusCodes.Status404NotFound] = Constants.SwaggerSummary.DialogActivityNotFound;
Responses[StatusCodes.Status410Gone] = Constants.SwaggerSummary.DialogDeleted;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,10 @@ public partial interface IServiceownerApi
/// <description>The given dialog ID was not found or is deleted</description>
/// </item>
/// <item>
/// <term>410</term>
/// <description>The dialog with the given key is removed</description>
/// </item>
/// <item>
/// <term>412</term>
/// <description>The supplied Revision does not match the current Revision of the dialog</description>
/// </item>
Expand Down Expand Up @@ -835,7 +839,7 @@ public partial interface IServiceownerApi
/// </item>
/// <item>
/// <term>404</term>
/// <description>The given dialog ID was not found or was deleted, or the given activity ID was not found.</description>
/// <description>The specified dialog ID or activity ID was not found.</description>
/// </item>
/// <item>
/// <term>410</term>
Expand Down Expand Up @@ -1722,13 +1726,29 @@ public partial class V1ServiceOwnerDialogsCommandsUpdate_Content
[JsonPropertyName("title")]
public V1CommonContent_ContentValue Title { get; set; }

/// <summary>
/// An optional non-sensitive title of the dialog.
/// <br/>Used for search and list views if the user authorization does not meet the required eIDAS level
/// </summary>

[JsonPropertyName("nonSensitiveTitle")]
public V1CommonContent_ContentValue NonSensitiveTitle { get; set; }

/// <summary>
/// A short summary of the dialog and its current state. Must be text/plain.
/// </summary>

[JsonPropertyName("summary")]
public V1CommonContent_ContentValue Summary { get; set; }

/// <summary>
/// An optional non-sensitive summary of the dialog and its current state.
/// <br/>Used for search and list views if the user authorization does not meet the required eIDAS level
/// </summary>

[JsonPropertyName("nonSensitiveSummary")]
public V1CommonContent_ContentValue NonSensitiveSummary { get; set; }

/// <summary>
/// Overridden sender name. If not supplied, assume "org" as the sender name. Must be text/plain if supplied.
/// </summary>
Expand Down Expand Up @@ -2577,13 +2597,29 @@ public partial class V1ServiceOwnerDialogsQueriesSearch_Content
[JsonPropertyName("title")]
public V1CommonContent_ContentValue Title { get; set; }

/// <summary>
/// An optional non-sensitive title of the dialog.
/// <br/>Used for search and list views if the user authorization does not meet the required eIDAS level
/// </summary>

[JsonPropertyName("nonSensitiveTitle")]
public V1CommonContent_ContentValue NonSensitiveTitle { get; set; }

/// <summary>
/// A short summary of the dialog and its current state.
/// </summary>

[JsonPropertyName("summary")]
public V1CommonContent_ContentValue Summary { get; set; }

/// <summary>
/// An optional non-sensitive summary of the dialog and its current state.
/// <br/>Used for search and list views if the user authorization does not meet the required eIDAS level
/// </summary>

[JsonPropertyName("nonSensitiveSummary")]
public V1CommonContent_ContentValue NonSensitiveSummary { get; set; }

/// <summary>
/// Overridden sender name. If not supplied, assume "org" as the sender name.
/// </summary>
Expand Down Expand Up @@ -2871,13 +2907,29 @@ public partial class V1ServiceOwnerDialogsQueriesGet_Content
[JsonPropertyName("title")]
public V1CommonContent_ContentValue Title { get; set; }

/// <summary>
/// An optional non-sensitive title of the dialog.
/// <br/>Used for search and list views if the user authorization does not meet the required eIDAS level
/// </summary>

[JsonPropertyName("nonSensitiveTitle")]
public V1CommonContent_ContentValue NonSensitiveTitle { get; set; }

/// <summary>
/// A short summary of the dialog and its current state.
/// </summary>

[JsonPropertyName("summary")]
public V1CommonContent_ContentValue Summary { get; set; }

/// <summary>
/// An optional non-sensitive summary of the dialog and its current state.
/// <br/>Used for search and list views if the user authorization does not meet the required eIDAS level
/// </summary>

[JsonPropertyName("nonSensitiveSummary")]
public V1CommonContent_ContentValue NonSensitiveSummary { get; set; }

/// <summary>
/// Overridden sender name. If not supplied, assume "org" as the sender name.
/// </summary>
Expand Down Expand Up @@ -3633,6 +3685,14 @@ public partial class V1ServiceOwnerDialogsCommandsCreate_Content
[JsonPropertyName("title")]
public V1CommonContent_ContentValue Title { get; set; }

/// <summary>
/// An optional non-sensitive title of the dialog.
/// <br/>Used for search and list views if the user authorization does not meet the required eIDAS level
/// </summary>

[JsonPropertyName("nonSensitiveTitle")]
public V1CommonContent_ContentValue NonSensitiveTitle { get; set; }

/// <summary>
/// A short summary of the dialog and its current state.
/// <br/>Supported media types: text/plain
Expand All @@ -3641,6 +3701,14 @@ public partial class V1ServiceOwnerDialogsCommandsCreate_Content
[JsonPropertyName("summary")]
public V1CommonContent_ContentValue Summary { get; set; }

/// <summary>
/// An optional non-sensitive summary of the dialog and its current state.
/// <br/>Used for search and list views if the user authorization does not meet the required eIDAS level
/// </summary>

[JsonPropertyName("nonSensitiveSummary")]
public V1CommonContent_ContentValue NonSensitiveSummary { get; set; }

/// <summary>
/// Overridden sender name. If not supplied, assume "org" as the sender name. Must be text/plain if supplied.
/// <br/>Supported media types: text/plain
Expand Down

0 comments on commit 8a35403

Please sign in to comment.