Add JSON schema generation for method return types#16
Conversation
Introduces the ability to generate and expose JSON Schemas for method return types in the ReflectorNet library. Adds OutputSchema property to MethodWrapper, implements GetReturnSchema in Reflector and JsonSchema, and bumps the package version to 2.1.0.
There was a problem hiding this comment.
Pull Request Overview
This PR adds JSON schema generation for method return types to the ReflectorNet library, complementing the existing input schema support. Users can now programmatically inspect the structure of method outputs through new APIs.
- Added
GetReturnSchemamethod to bothReflectorandJsonSchemaclasses for generating return type schemas - Enhanced
MethodWrapperclass withOutputSchemaproperty to expose return type schemas - Bumped package version from 2.0.0 to 2.1.0 to reflect the new feature
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| ReflectorNet/src/Utils/Json/JsonSchema.cs | Implements core logic for return schema generation with void/Task handling |
| ReflectorNet/src/Reflector/Reflector.Json.cs | Adds public API method for return schema generation |
| ReflectorNet/src/Reflector/MethodWrapper.cs | Integrates output schema support across all constructors |
| ReflectorNet/ReflectorNet.csproj | Updates package version to 2.1.0 |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
This pull request introduces support for generating and exposing JSON schemas for method return types in the ReflectorNet library. This enhancement allows users to programmatically inspect the structure of method outputs, in addition to existing input schema support. The main changes involve adding new methods to generate return type schemas and updating the
MethodWrapperclass to provide access to these schemas.Return type schema support:
GetReturnSchemamethod to theReflectorclass, which generates a JSON schema for a method's return type, returningnullforvoid,Task, orValueTaskreturn types. [1] [2]GetReturnSchemain theJsonSchemautility class.MethodWrapper enhancements:
MethodWrapperclass to store and expose the output schema via a newOutputSchemaproperty, initializing it in all relevant constructors. [1] [2] [3] [4]Project metadata:
2.0.0to2.1.0inReflectorNet.csprojto reflect the new feature.