Skip to content

Commit

Permalink
fix: make call better accessible in swagger doc
Browse files Browse the repository at this point in the history
  • Loading branch information
buehler committed Jan 26, 2024
1 parent 61eff41 commit 99a3715
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
8 changes: 1 addition & 7 deletions MumbleApi/Models/PostSearchParameters.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,47 +6,41 @@ public record PostSearchParameters : PaginationParameters
{
/// <summary>
/// ID of a post. If set, only return posts that are newer than the given post ID.
/// If omitted, no newer than filter is applied.
/// If omitted, no newer than filter is applied. The ID is a ULID (e.g. 01GEESHPQQ4NJKNZJN9AKWQW6G).
/// </summary>
/// <example>01GEESHPQQ4NJKNZJN9AKWQW6G</example>
[FromQuery(Name = "newerThan")]
public Ulid? NewerThan { get; set; }

/// <summary>
/// ID of a post. If set, only return posts that are older than the given post ID.
/// If omitted, no older than filter is applied.
/// </summary>
/// <example>01GEESHPQQ4NJKNZJN9AKWQW6G</example>
[FromQuery(Name = "olderThan")]
public Ulid? OlderThan { get; set; }

/// <summary>
/// If set, search for posts that contain a specific text.
/// </summary>
/// <example>Hello World</example>
[FromQuery(Name = "text")]
public string? Text { get; set; }

/// <summary>
/// Search for posts that contain this tag (#TEXT).
/// </summary>
/// <example>["newpost", "cas"]</example>
[FromQuery(Name = "tags")]
public IReadOnlyList<string>? Tags { get; set; }

/// <summary>
/// Search for posts that were created by one of the given users (ID).
/// All IDs must be valid user IDs and are "OR"ed.
/// </summary>
/// <example>["179944860378202369", "179944860378202340"]</example>
[FromQuery(Name = "creators")]
public IReadOnlyList<string>? Creators { get; set; }

/// <summary>
/// Search for posts that were liked by specific user(s).
/// Multiple user IDs are "OR"ed (if a post is liked by user A OR B).
/// </summary>
/// <example>["179944860378202369", "179944860378202340"]</example>
[FromQuery(Name = "likedBy")]
public IReadOnlyList<string>? LikedBy { get; set; }

Expand Down
3 changes: 1 addition & 2 deletions MumbleApi/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,8 @@ await db.Database.ExecuteSqlInterpolatedAsync(
{
Format = "ULID",
Title = "ULID",
Description = "Universally Unique Lexicographically Sortable Identifier",
Description = "Universally Unique Lexicographically Sortable Identifier (e.g. 01GEESHPQQ4NJKNZJN9AKWQW6G)",
Type = "string",
Example = new OpenApiString("01GEESHPQQ4NJKNZJN9AKWQW6G"),
ExternalDocs = new() { Description = "ULID Specification", Url = new("https://github.com/ulid/spec"), },
});

Expand Down

0 comments on commit 99a3715

Please sign in to comment.