[Issue#392] Correct issue with OAuth scopes not propogated correctly (#1982)

If a path defined security to an OAuth type, and defined scopes, the scopes from the
components definition were still being used, rather than the (most likely shorter) list
of specific scopes for the path.

This copies all the component security information over EXCEPT for the scopes. The scopes
to be included are determined by the path's security settings.

NOTE: Modified the petstore.yaml file so the GET operations only have read:pets scope and
utilized the Kotlin server sample to verify output. Sample output updated only for this scenario
This commit is contained in:
Mike Wilkes
2019-04-05 06:49:29 -04:00
committed by William Cheng
parent b5ede4b339
commit 67b3766332
6 changed files with 216 additions and 48 deletions

View File

@@ -1,24 +0,0 @@
package org.openapitools.model
import java.util.Objects
import com.fasterxml.jackson.annotation.JsonProperty
import javax.validation.Valid
import javax.validation.constraints.*
import io.swagger.annotations.ApiModelProperty
/**
* A category for a pet
* @param id
* @param name
*/
data class Category (
@ApiModelProperty(example = "null", value = "")
@JsonProperty("id") val id: Long? = null,
@ApiModelProperty(example = "null", value = "")
@JsonProperty("name") val name: String? = null
) {
}