Forum Discussion

Faf's avatar
Faf
New Contributor
6 hours ago

Bug report about parameter references

I'm new to REST, so I have been using Copilot to generate a YAML file to import in SoapUI 5.10.0. The AI generated and "normalized" a YAML file for openAPI version 3.1.0. 

This YAML is perfectly fine in Visual Studio and in the online Swagger editor. SoapUI, on the other hand, coughs up an error on this part:

      parameters:   

           $ref: '#/components/parameters/sessionId'

After deciding to take the long but infallible road of removing parts of the YAML, it all came down to the hyphen preceding the "$ref" keyword. Copilot told me that this character is used to identify an array. Otherwise, it becomes an object.

Anyway, I removed it and the import worked, up to the next reference that also contained the hyphen... but this time, it was two references:

      parameters:

        - $ref: '#/components/parameters/UserId'

        - $ref: '#/components/parameters/sessionId'

I had a feeling that things would go bad, here, and I was right. OpenUI did not like the hyphen. But removing the hyphens caused it to be an object (or something). This time, it didn't like that it was NOT an array. 

So, in SoapUI, I'm stuck. I can't remove the '-', but I also can't keep them.

Any thoughts?

Here's the original header of my YAML.

     openapi: 3.1.0

     # jsonSchemaDialect: https://json-schema.org/draft/2020-12/schema

     jsonSchemaDialect: https://spec.openapis.org/oas/3.1/dialect/base

The commented dialect was generated by Copilot. But the online Swagger editor did not like it, so I replaced it. 

2 Replies

  • Faf's avatar
    Faf
    New Contributor

    I need to amend this... I was TOO quick to say that SoapUI did not like the two references with the hyphen. It actually does. I had more than one action in the call definition, and had forgotten to update the other actions (PUT and DELETE). However, after removing the hyphens and seeing that SoapUI liked it, I went ahead and imported it in the online swagger editor. It does NOT like it. It says "Content was not recognized as supported language in particular format." Which makes sense if the parameters are supposed to be in an array and nothing else.

    I'm still stuck though. I can't work with two versions of the same YAML, and it seems like, according to Copilot, SoapUI is the product with a bug.

    Back to my original question: Any thoughts? 

  • SoapUI doesn’t support openapi 3.x directly, only swagger 2.0. 

    you can work around it by using https://github.com/apiaddicts/openapi2soapui which accepts a swagger 2.0 or openapi 3.x specification as an input and provides a SoapUI suite as an output.

    The output suites are also ReadyAPI compatible, which does directly support OpenAPI 3.x