· Jan 20

Using ^%REST to Create a Service - Correct OpenAPI 2.0 version was not specified

Update - I answered my own question, so I'll just leave this here in case it can help someone.

Hi All

I'm following the tutorial Creating and Editing REST Services and have reached the step Using ^%REST to Create a Service and have encountered an error.

Here is grab of the terminal command:

REST Command Line Interface (CLI) helps you CREATE or DELETE a REST application.
Enter an application name or (L)ist all REST applications (L): PcConRest
REST application not found: PcConRest
Do you want to create a new REST application? Y or N (Y): Y
File path or absolute URL of a swagger document.
If no document specified, then create an empty application.
OpenAPI 2.0 swagger: e:\temp\schema.json
OpenAPI 2.0 swagger document: e:\temp\schema.json
Confirm operation, Y or N (Y): Y
-----Creating REST application: PcConRest-----
Error creating application
ERROR #8738: Correct OpenAPI 2.0 version was not specified: . <$.swagger>
  > ERROR #5490: Error running generator for method '%OnCompile:PcConRest.spec'
ERROR: %REST.Spec.cls(%OnCompile) of generated code compiling subclass 'PcConRest.spec'
    > ERROR #5030: An error occurred while compiling class 'PcConRest.spec'
Enter an application name or (L)ist all REST applications (L):

The error produced is Correct OpenAPI 2.0 version was not specified, and I have downloaded the OpenAPI-Specification v2.0 schema from here  - this location was taken directly from the tutorial document referenced above. Where can I find the correct version, or am I doing something wrong?



Product version: IRIS 2021.1
$ZV: IRIS for Windows (x86-64) 2021.2.1 (Build 654U) Fri Mar 18 2022 06:09:35 EDT
Discussion (4)1
Log in or sign up to continue

Hi Ashok, thanks for your reply and link, which was very interesting.

I have checked the swagger document and it appears to contain the correct value though:

   "properties": {
        "swagger": {
            "type": "string",
            "enum": [
            "description": "The Swagger version of this document."