Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 15, 2025

Adds comprehensive user documentation for integrating Activout.RestClient into projects, covering interface-based API client generation and MockHttp testing patterns.

Documentation Structure

  • Installation: Core package, JSON serialization options (System.Text.Json/Newtonsoft.Json), and MockHttp testing dependencies
  • Interface Definition: Attributes for defining REST endpoints ([Get], [Post], [Path], [QueryParam], etc.) with complete examples
  • Client Creation: Builder pattern setup for both JSON serializers, including DI integration patterns
  • MockHttp Testing: GET/POST/PUT request mocking, query parameters, error response handling, and When() vs Expect() patterns
  • Advanced Features: Custom headers, form data, multipart uploads, synchronous methods

Example Pattern

// Define interface
[Path("movies")]
[ErrorResponse(typeof(ErrorResponse))]
public interface IMovieReviewService
{
    [Get("/{movieId}/reviews")]
    Task<IEnumerable<Review>> GetAllReviews(string movieId);
}

// Unit test with MockHttp
_mockHttp
    .When($"{BaseUri}/movies/{movieId}/reviews")
    .Respond("application/json", "[{\"Stars\":5,\"Text\":\"Great!\"}]");

All examples derive from actual test implementations in the repository.

Original prompt

This section details on the original issue you should resolve

<issue_title>instructions.md for users</issue_title>
<issue_description>Generate an instructions.md file that can be added to projects using this project (Activout.RestClient) so that they can correctly generate API client interfaces given a description of one or more api endpoints

Also describe how these interfaces are unit tested using MockHttp.</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

@coderabbitai
Copy link

coderabbitai bot commented Dec 15, 2025

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Note

Free review on us!

CodeRabbit is offering free reviews until Wed Dec 17 2025 to showcase some of the refinements we've made.

Comment @coderabbitai help to get the list of available commands and usage tips.

Copilot AI and others added 3 commits December 15, 2025 15:19
Co-authored-by: twogood <189982+twogood@users.noreply.github.com>
Co-authored-by: twogood <189982+twogood@users.noreply.github.com>
Co-authored-by: twogood <189982+twogood@users.noreply.github.com>
Copilot AI changed the title [WIP] Add instructions.md for generating API client interfaces Add instructions.md for generating API clients and unit testing with MockHttp Dec 15, 2025
Copilot AI requested a review from twogood December 15, 2025 15:27
@twogood
Copy link
Owner

twogood commented Dec 15, 2025

@copilot With instructions.md I meant to generate like copilot-instructions.md, is this still good?

Copy link
Contributor Author

Copilot AI commented Dec 15, 2025

@copilot With instructions.md I meant to generate like copilot-instructions.md, is this still good?

I created instructions.md as comprehensive user documentation (622 lines) for developers integrating Activout.RestClient into their projects - covering installation, interface definition, client creation, and MockHttp testing patterns.

The .github/copilot-instructions.md file is much shorter (12 lines) and contains coding conventions for GitHub Copilot when working on this repository itself (e.g., "use file-scoped namespaces", "use primary constructors").

These serve different purposes:

  • instructions.md = User guide for library consumers
  • .github/copilot-instructions.md = Coding guidelines for Copilot when editing this repo

Based on the original issue ("file that can be added to projects using this project"), I believe the current approach is correct. However, if you want something different - perhaps:

  1. A shorter, more concise format?
  2. Instructions specifically for AI assistants working in consumer projects?
  3. Something else?

Please clarify what format you'd prefer and I'll adjust accordingly.

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.

instructions.md for users

2 participants