Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8058695
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T09:26:23+00:00 2026-06-05T09:26:23+00:00

I am looking to use Swagger to document my restful interface. The problem is

  • 0

I am looking to use Swagger to document my restful interface. The problem is that I do not want to automatically generate my documentation by annotating my code. Basically I don’t want to couple my internal data model to the virtual data model exposed by the interface. It appears that I can just have my server provide a Resources.json file and then a corresponding JSON file for each resource handler. However, when I tried this I ran into lots of little gotchas while attempting to define the JSON correct syntax and provide the correct HTTP header response fields.

Has anyone used Swagger in this way? Anyone have some documentation or examples? Everything that I could find centered around simply using the client libraries to generate things for you.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T09:26:25+00:00Added an answer on June 5, 2026 at 9:26 am

    I’ve created static json files for swagger before. The documentation is kinda lacking in describing the json required to get swagger to work.

    If you look at their spec and look at their example petstore.json. You should be able to get a pretty good idea of how to structure your json.

    Or look at my examples.

    If you have any more questions feel free to ask.

    main.json

    {
        "apiVersion": "0.0.4542.22887",
        "swaggerVersion": "1.0",
        "basePath": "http://local.api.com/api/doc",
        "apis": [
            {
                "path": "/donuts",
                "description": "Operations about donuts"
            },
            {
                "path": "/cakes",
                "description": "Operations about cakes"
            },
            {
                "path": "/bagels",
                "description": "Operations about bagels"
            }
        ]
    
    }
    

    donuts.json

    {
        "apiVersion": "0.0.4542.22887",
        "swaggerVersion": "1.0",
        "basePath": "http://local.api.com/api",
        "resourcePath": "/donuts",
        "apis": [
            {
                "path": "/donuts/{page}/{pagesize}",
                "description": "Get donuts by page",
                "operations": [
                    {
                        "httpMethod": "GET",
                        "notes": "Get a donut with page and size",
                        "nickname": "getDonutsByPageAndSize",
                        "summary": "Get a collection of donuts by page and pagesize.",
                        "parameters": [
                            {
                                "name": "page",
                                "description": "the page of the collection",
                                "dataType": "int",
                                "required": true,
                                "allowMultiple": false,
                                "paramType": "path"
                            },
                            {
                                "name": "pagesize",
                                "description": "the size of the collection",
                                "dataType": "int",
                                "required": true,
                                "allowMultiple": false,
                                "paramType": "path"
                            }
                        ],
                        "errorResponses": [ ]
                    }
                ]
            },
        ]
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm not looking to use something big like QT or wxWidgets' APIs. I just
I'm looking to use NVelocity in my ASP.NET MVC application, not as a view
I am looking to use a database project in visual studio 2010 so that
I'm looking to use in_place_editor_field on an Index page of items. Basically I want
I am looking to use the map file to resolve addresses that I get
I am looking to use nuget without committing the packages . I want to
I am looking to use FTP to write a mainframe jobstream. To do that,
I'm a long-time eclipse user looking to use netbeans now that I've tried netbeans
I am looking to use quartz to schedule emails, but I'm not sure which
I'm looking to use UISwipeGestureRecognizer for implementing a tweetie like interface for my application.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.