Skip to content

Support Ref in OpenApiVersion #2377

Closed
Closed
@nikitasius

Description

@nikitasius

Description:

I add a param OpenApiVersionParam with a value 3.0.3 and it doesn't pass the validation sam validate

Steps to reproduce:

Parameters:
  StageNameParam:
    Type: String
    Default: "debug"
    Description: API Stage name
  OpenApiVersionParam:
    Type: String
    Default: "3.0.0"
    Description: to remove fcking default Stage

and below in Resources:

FAILS:

  DebugApi:
    Type: AWS::Serverless::Api
    Properties:
      OpenApiVersion: !Ref OpenApiVersionParam
      StageName: !Ref StageNameParam
      EndpointConfiguration:
        Type: REGIONAL

WORK:

  DebugApi:
    Type: AWS::Serverless::Api
    Properties:
      OpenApiVersion: 3.0.3
      StageName: !Ref StageNameParam
      EndpointConfiguration:
        Type: REGIONAL

Observed result:

Fails: Error: [InvalidResourceException('DebugApi', "The OpenApiVersion value must be of the format '3.0.0'.")] ('DebugApi', "The OpenApiVersion value must be of the format '3.0.0'.")

Expected result:

Should work.

Additional environment details (Ex: Windows, Mac, Amazon Linux etc)

  1. OS: Linux pentagon 5.10.0-13-amd64 #1 SMP Debian 5.10.106-1 (2022-03-17) x86_64 GNU/Linux
  2. If using SAM CLI, sam --version: SAM CLI, version 1.46.0
  3. AWS region: eu-west-1

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions