oneOf appears to not work correctly (Being treated like allOf)

Aperta
#269 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
java
Ambito
devtools

Direzione di ricerca

Inizia riproducendo l’errore di validazione dell’aggiornamento segnalato con lo schema e il payload contenenti VpcLinkId e BaseURI. Confronta i risultati della validazione per esattamente uno, entrambi e nessuno dei rami oneOf; il lavoro è completato quando un ramo valido viene accettato, mentre le combinazioni non valide producono gli errori previsti.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Version 1.0.5 of the Java plugin

Schema:

{
    "typeName": "OBFUSCATED::ApiGateway::RestApi",
    "description": "An example resource schema demonstrating some basic constructs and validation rules.",
    "sourceUrl": "https://github.com/aws-cloudformation/aws-cloudformation-rpdk.git",
    "properties": {
        "RestApiId": {
            "type": "string"
        },
        "Name": {
            "description": "Api Name",
            "type": "string"
        },
        "AuthorizerLambdaArn": {
            "type": "string"
        },
        "AuthorizerCredentials": {
            "type": "string"
        },
        "Version": {
            "type": "string"
        },
        "SwaggerS3Location": {
            "description": "Swagger File S3 Location.",
            "type": "object",
            "properties": {
                "Bucket": {
                    "type": "string"
                },
                "Key": {
                    "type": "string"
                },
                "Version" : {
                    "type": "string"
                }
            },
            "required": [
                "Bucket",
                "Key"
            ]

        },
        "EndpointType": {
            "description": "Gateway Endpoint Type",
            "enum" : ["REGIONAL", "EDGE", "PRIVATE"],
            "type": "string"
        },
        "ValidateRequests" : {
            "type": "boolean",
            "description" : "Use Api Gateway request validatoin"
        }
    },
    "oneOf": [
        {
            "properties": {
                "VpcLinkId": {
                    "type": "string"
                },
                "BaseURI": {
                    "type": "string"
                }
            },
            "required":  ["VpcLinkId", "BaseURI"]
        },
        {
            "properties": {
                "LambdaArn" : {
                    "type": "string"
                }
            },
            "required" : ["LambdaArn"]
        }
    ],
    "additionalProperties": false,
    "required": [
        "Name",
        "SwaggerS3Location",
        "EndpointType",
        "AuthorizerLambdaArn",
        "AuthorizerCredentials"
    ],
    "writeOnlyProperties": [
        "/properties/VpcLinkId",
        "/properties/BaseURI",
        "/properties/LambdaArn",
        "/properties/SwaggerS3Location",
        "/properties/ValidateRequests"
    ],
    "readOnlyProperties": [
        "/properties/RestApiId",
        "/properties/Version"
    ],
    "primaryIdentifier": [
        "/properties/RestApiId"
    ],
    "handlers": {
        "create": {
            "permissions": [
                "iam:PassRole",
                "s3:GetObject",
                "s3:GetBucketLocation",
                "apigateway:PATCH",
                "apigateway:POST",
                "apigateway:PUT"
            ]
        },
        "read": {
            "permissions": [
                "apigateway:GET"
            ]
        },
        "update": {
            "permissions": [
                "iam:PassRole",
                "s3:GetObject",
                "s3:GetBucketLocation",
                "apigateway:PATCH",
                "apigateway:POST",
                "apigateway:PUT"
            ]
        },
        "delete": {
            "permissions": [
                "apigateway:DELETE"
            ]
        }
    }
}

Error when using only VpcLinkId and BaseURI in an update operation:

Model validation failed (#: #: only 1 subschema matches out of 2)\n#: 2 schema violations found (#)

Lingua principale
Java
Stelle
30
Fork
48
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di aws-cloudformation/cloudformation-cli-java-plugin

Tutte le issue di aws-cloudformation/cloudformation-cli-java-plugin

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.