Skip to content

Conversation

@kaua-alves-queiros
Copy link
Contributor

feat(docs): unify response schema for the GetSessions endpoint

  • Adopted a single predictable schema (GetSessionsResponse) for all endpoint responses
  • Overrides the middleware's default documentation (403), ensuring consistent return types
  • Added 404 response for when no sessions are found
  • Added a success message in the response object
  • Updates swagger documentation for 200, 404, 403, and 500 using the same schema
  • Improves SDK consistency (nswag now generates only one response class)

autogenerated GetSessionsResponse in c# example

[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.5.0.0 (NJsonSchema v11.4.0.0 (Newtonsoft.Json v13.0.0.0))")]
    public partial class GetSessionsResponse
    {

        [System.Text.Json.Serialization.JsonPropertyName("success")]
        public bool Success { get; set; }

        [System.Text.Json.Serialization.JsonPropertyName("result")]
        public System.Collections.Generic.ICollection<string> Result { get; set; }

        [System.Text.Json.Serialization.JsonPropertyName("message")]
        public string Message { get; set; }

        private System.Collections.Generic.IDictionary<string, object> _additionalProperties;

        [System.Text.Json.Serialization.JsonExtensionData]
        public System.Collections.Generic.IDictionary<string, object> AdditionalProperties
        {
            get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary<string, object>()); }
            set { _additionalProperties = value; }
        }

    }

- Adopted a single predictable schema (GetSessionsResponse) for all endpoint responses
- Overrides the middleware's default documentation (403), ensuring consistent return types
- Added 404 response for when no sessions are found
- Added a success message in the response object
- Updates swagger documentation for 200, 404, 403, and 500 using the same schema
- Improves SDK consistency (nswag now generates only one response class)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant