feat(docs): public api kdocs (#658)
- enable rule for checking undocumented public api - add kdoc skill ## How Has This Been Tested? ./gradlew detekt ## Breaking Changes none ## Types of changes - [ ] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [x] Documentation update ## Checklist - [x] I have read the [MCP Documentation](https://modelcontextprotocol.io) - [x] My code follows the repository's style guidelines - [x] New and existing tests pass locally - [ ] I have added appropriate error handling - [x] I have added or updated documentation as needed --------- Co-authored-by: Konstantin Pavlov <1517853+kpavlov@users.noreply.github.com>
This commit is contained in:
parent
e5e5ec206f
commit
33923bc7c9
3 changed files with 260 additions and 27 deletions
|
|
@ -26,6 +26,8 @@ internal const val SESSION_ID_PARAM = "sessionId"
|
|||
* Server transport for SSE: this will send messages over an SSE connection and receive messages from HTTP POST requests.
|
||||
*
|
||||
* Creates a new SSE server transport, which will direct the client to POST messages to the relative or absolute URL identified by `_endpoint`.
|
||||
*
|
||||
* @property sessionId unique identifier for this transport session, generated randomly on creation
|
||||
*/
|
||||
@OptIn(ExperimentalAtomicApi::class)
|
||||
public class SseServerTransport(private val endpoint: String, private val session: ServerSSESession) :
|
||||
|
|
|
|||
|
|
@ -40,6 +40,8 @@ private val logger = KotlinLogging.logger {}
|
|||
|
||||
/**
|
||||
* Represents a server session.
|
||||
*
|
||||
* @property sessionId unique identifier for this session, generated randomly on creation
|
||||
*/
|
||||
@Suppress("TooManyFunctions")
|
||||
public open class ServerSession(
|
||||
|
|
|
|||
|
|
@ -71,6 +71,7 @@ private data class SessionContext(val session: ServerSSESession?, val call: Appl
|
|||
* - No session validation is performed
|
||||
*
|
||||
* @param configuration Transport configuration. See [Configuration] for available options.
|
||||
* @property sessionId session identifier assigned after initialization, or `null` in stateless mode
|
||||
*/
|
||||
@OptIn(ExperimentalUuidApi::class, ExperimentalAtomicApi::class)
|
||||
@Suppress("TooManyFunctions")
|
||||
|
|
@ -122,28 +123,16 @@ public class StreamableHttpServerTransport(private val configuration: Configurat
|
|||
)
|
||||
|
||||
/**
|
||||
* Configuration for managing various aspects of the StreamableHttpServerTransport.
|
||||
*
|
||||
* @property enableJsonResponse Determines whether the server should return JSON responses.
|
||||
* Defaults to `false`.
|
||||
*
|
||||
* @property enableDnsRebindingProtection Enables DNS rebinding protection.
|
||||
* Defaults to `false`.
|
||||
*
|
||||
* @property allowedHosts A list of hosts allowed for server communication.
|
||||
* Defaults to `null`, allowing all hosts.
|
||||
*
|
||||
* @property allowedOrigins A list of allowed origins for CORS (Cross-Origin Resource Sharing).
|
||||
* Defaults to `null`, allowing all origins.
|
||||
*
|
||||
* @property eventStore The `EventStore` instance for handling resumable events.
|
||||
* Defaults to `null`, disabling resumability.
|
||||
*
|
||||
* @property retryInterval Retry interval for event handling or reconnection attempts.
|
||||
* Defaults to `null`.
|
||||
* Configuration options for [StreamableHttpServerTransport].
|
||||
*
|
||||
* @property enableJsonResponse when `true`, returns direct JSON responses instead of SSE streams
|
||||
* @property enableDnsRebindingProtection enables DNS rebinding protection
|
||||
* @property allowedHosts list of hosts allowed for server communication, or `null` to allow all
|
||||
* @property allowedOrigins list of allowed CORS origins, or `null` to allow all
|
||||
* @property eventStore store for resumable events, or `null` to disable resumability
|
||||
* @property retryInterval retry interval for SSE reconnection attempts
|
||||
* @property maxRequestBodySize Maximum allowed size (in bytes) for incoming request bodies.
|
||||
* Defaults to 4 MB (4,194,304 bytes).
|
||||
* Defaults to 4 MB (4,194,304 bytes).
|
||||
*/
|
||||
public class Configuration(
|
||||
public val enableJsonResponse: Boolean = false,
|
||||
|
|
|
|||
Loading…
Reference in a new issue