Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need an option to influence resource ordering #205

Closed
JohnRudolfLewis opened this issue Nov 9, 2016 · 3 comments
Closed

Need an option to influence resource ordering #205

JohnRudolfLewis opened this issue Nov 9, 2016 · 3 comments
Assignees
Labels
Milestone

Comments

@JohnRudolfLewis
Copy link

I would like an option to influence the ordering of resources based on the order that they exist in my swagger.

Desired:
From the example below, I would want /v1/zebras to appear before /v1/apples

Actual:
The resources are sorted alphabetically

convertSwagger2markup {
    swaggerInput file("swagger.yaml").toString()
    outputDir asciiDocOutputDir
    config = [
            'swagger2markup.pathsGroupedBy' : 'TAGS',
            'swagger2markup.tagOrderBy' : 'AS_IS',
            'swagger2markup.propertyOrderBy' : 'AS_IS',
            'swagger2markup.extensions.springRestDocs.snippetBaseUri': snippetsOutputDir.getAbsolutePath()]
}
swagger: '2.0'
info:
  version: 0.0.0
  title: Simple API
tags:
  - name: Zebras
  - name: Aardvarks
paths:
  /v1/zebras:
    get:
      description: I would like this to appear before Aardvarks
      tags:
        - Zebras
      responses:
        200:
          description: OK
          schema:
            $ref: "#/definitions/Zebra"

  /v1/aardvarks:
    get:
      description: I would like this to appear after zebras
      tags:
        - Aardvarks
      responses:
        200:
          description: OK
          schema:
            $ref: "#/definitions/Aardvark"

definitions:
  
 
  Aardvark:
    type: object
    allOf:
      - $ref: "#/definitions/Animal"
    properties:
      somePropertyOfAardvark:
        type: string
        description: this should be displayed in the definition of Aardvark but doesn't
      
  Zebra:
    type: object
    allOf:
      - $ref: "#/definitions/Animal"
    properties:
      somePropertyOfZebra:
        type: string
        description: this should be displayed in the definition of Zebra but doesn't
    required:
      - somePropertyOfZebra
  
  Animal:
    type: object
    properties:
      somePropertyOfAnimal:
        type: string
      "_etag":
        type: string
        readOnly: true
        description: This property is actually named _etag but shows up without the underscore. It also should show that it is a readOnly property.
@RobWin
Copy link
Member

RobWin commented Nov 10, 2016

Hello,
this is a known limitation of Guava MultiMap::hashkeys(). https://github.com/Swagger2Markup/swagger2markup/blob/master/src/main/java/io/github/swagger2markup/internal/utils/TagUtils.java#L62

I check if I can fix this.

@RobWin
Copy link
Member

RobWin commented Nov 10, 2016

Should work in v1.1.1-SNAPSHOT

@RobWin RobWin added the bug label Nov 10, 2016
@RobWin RobWin added this to the 1.1.1 milestone Nov 10, 2016
@RobWin RobWin self-assigned this Nov 10, 2016
@RobWin
Copy link
Member

RobWin commented Dec 1, 2016

Fixed in v1.1.1

@RobWin RobWin closed this as completed Dec 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants