Skip to content

Commit

Permalink
feat: rename parameters to queryParameters for better clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
TheMrMilchmann committed Sep 3, 2020
1 parent 8fc5d8a commit 43956b1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/main/kotlin/com/gw2tb/apigen/internal/dsl/dsl.kt
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ internal class GW2APIEndpointBuilder(private val route: String) {
security = security ?: emptySet(),
isLocalized = isLocalized,
queryTypes = if (this::queryTypes.isInitialized) queryTypes else emptySet(),
parameters = parameters.values.toList(),
queryParameters = parameters.values.toList(),
pathParameters = pathParameters.values.toList(),
_schema = schema
)
Expand All @@ -156,7 +156,7 @@ internal class GW2APIEndpointBuilder(private val route: String) {
var isLocalized: Boolean = false

private lateinit var queryTypes: Set<QueryType>
private val parameters: MutableMap<String, Parameter> = mutableMapOf()
private val parameters: MutableMap<String, QueryParameter> = mutableMapOf()
private val pathParameters: MutableMap<String, PathParameter> = mutableMapOf()

fun security(vararg required: TokenScope) { security = required.toSet() }
Expand Down Expand Up @@ -218,7 +218,7 @@ internal class GW2APIEndpointBuilder(private val route: String) {
fun parameter(name: String, type: SchemaPrimitive, description: String, key: String = name.toLowerCase(), isOptional: Boolean = false) {
check(key !in parameters)

parameters[key] = Parameter(key, type, description, name, isOptional)
parameters[key] = QueryParameter(key, type, description, name, isOptional)
}

fun pathParameter(key: String, type: SchemaPrimitive, description: String, name: String = key) {
Expand Down
4 changes: 2 additions & 2 deletions src/main/kotlin/com/gw2tb/apigen/model/Endpoint.kt
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import kotlin.time.*
* @param security TODO
* @param isLocalized whether or not the endpoint is localized
* @param queryTypes the [QueryType]s supported by the endpoint
* @param parameters the required parameters for the endpoint
* @param queryParameters the required parameters for the endpoint
* @param pathParameters the path parameters for the endpoint
*
* @since 0.1.0
Expand All @@ -49,7 +49,7 @@ public data class Endpoint internal constructor(
public val security: Set<TokenScope>,
public val isLocalized: Boolean,
public val queryTypes: Set<QueryType>,
public val parameters: List<Parameter>,
public val queryParameters: List<QueryParameter>,
public val pathParameters: List<PathParameter>,
private val _schema: EnumMap<V2SchemaVersion, SchemaType>
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ import com.gw2tb.apigen.schema.*
*
* @since 0.1.0
*/
public data class Parameter internal constructor(
public data class QueryParameter internal constructor(
val key: String,
val type: SchemaPrimitive,
val description: String,
val name: String,
val isOption: Boolean
val isOptional: Boolean
)

0 comments on commit 43956b1

Please sign in to comment.