File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed
ktor-shared/ktor-resources/common
src/io/ktor/resources/serialization
test/io/ktor/tests/resources Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -84,7 +84,7 @@ public class ResourcesFormat(
8484 val elementDescriptor = descriptor.getElementDescriptor(index)
8585 if (! elementDescriptor.isInline && elementDescriptor.kind is StructureKind .CLASS ) {
8686 collectAllParameters(elementDescriptor, result)
87- } else {
87+ } else if (elementDescriptor.kind !is StructureKind . OBJECT ) {
8888 result.add(Parameter (name, descriptor.isElementOptional(index)))
8989 }
9090 }
Original file line number Diff line number Diff line change 55package io.ktor.tests.resources
66
77import io.ktor.http.*
8+ import io.ktor.resources.Resource
89import io.ktor.resources.serialization.*
910import kotlinx.serialization.*
1011import kotlin.test.*
@@ -174,4 +175,15 @@ class ParametersSerializationTest {
174175 assertEquals(" c" , encoded[" charValue" ])
175176 assertEquals(" value" , encoded[" stringValue" ])
176177 }
178+
179+ @Resource(" v1" )
180+ private data object V1 {
181+ @Resource(" api" )
182+ data class Api (val parent : V1 )
183+ }
184+
185+ @Test
186+ fun testQueryParamsDoNotContainsObjectParent () {
187+ assertEquals(emptySet(), resourcesFormat.encodeToQueryParameters(serializer = serializer<V1 .Api >()))
188+ }
177189}
You can’t perform that action at this time.
0 commit comments