cancel
Showing results for 
Search instead for 
Did you mean: 

Structural error at paths./

misi01
New Contributor

Structural error at paths./

Completely new to Swagger, and I'm getting the error in the subject for the following JSON code (btw, this example of code is basically copied from a swagger created by an "expert" here at work. Trouble is, their code also fails the swagger editor test in the same way.

 

 

{
    "swagger": "2.0",
    "info": {
        "title": "--API-title--",
        "version": "1.0.0",
        "description": " --API-description--"
    },
    "host": "our.host.at.work",
    "basePath": "/my/basepath",
    "schemes": [
        "https"
    ],
    "paths": 
    {
        "/": {
            "GET": {
                "tags": [
                    "JPB261"
                ],
                "summary": "",
                "description": "endpoint desc",
                "produces": [
                    "application/json"
                ],
                "parameters": [

 

The error message I'm getting is

 

Structural error at paths./

should NOT have additional properties additionalProperty: GET

 
Could any kind soul tell me what I'm doing wrong? Thank you

 

2 REPLIES 2
misi01
New Contributor

Re: Structural error at paths./

Found the problem (I think). Turns out that Swagger doesn't seem to like the word GET and expects it to be get instead.

Who'd have guessed it was that finicky 🙂

HKosova
Moderator

Re: Structural error at paths./


@misi01 wrote:

Turns out that Swagger doesn't seem to like the word GET and expects it to be get instead.


Correct. HTTP methods in the "paths" section of an OpenAPI definition must be lowercase: get, post, etc.

https://github.com/OAI/OpenAPI-Specification/blob/main/versions/2.0.md#fixed-fields-4

 


Helen Kosova
SmartBear Documentation Team Lead
________________________
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
New Here?
Join us and watch the welcome video:
Top Kudoed Authors