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

Implement support for @deprecated annotations, fixing #96 #97

Merged
merged 2 commits into from
Jan 10, 2017

Conversation

vboerchers
Copy link

  • parse @Deprecated annotation from bytecode and @deprecated from JavaDoc
  • mark deprecated methods and methods of deprecated classes in all backends
  • render deprecation in warnings for asciidoc and plaintext backends
  • extend backend tests for deprecation

Here are example outputs (from the unit tests). While the swagger syntax is fixed the style of text and asciidoc is surely debatable:

plaintext

= REST resources of project name
1.0

== `GET rest/res19`

CAUTION: deprecated

=== Request
_No body_ + 

=== Response
*Content-Type*: `\\*/*`

==== `200 OK`
*Header*: `Location` + 
*Response Body*: (`java.lang.String`) + 

asciidoc

REST resources of project name:
1.0

GET rest/res19:
 Deprecated
 Request:
  No body

 Response:
  Content-Type: */*
  Status Codes: 200
   Header: Location
   Response Body: java.lang.String

swagger.json

{
  "swagger": "2.0",
  "info": {
    "version": "1.0",
    "title": "project name"
  },
  "host": "",
  "basePath": "/project name/rest",
  "schemes": [
    "http"
  ],
  "paths": {
    "/res19": {
      "get": {
        "consumes": [],
        "produces": [],
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "Location": {
                "type": "string"
              }
            },
            "schema": {
              "type": "string"
            }
          }
        },
        "deprecated": true
      }
    }
  },
  "definitions": {}
}

* parse @deprecated annotation from bytecode and @deprecated from JavaDoc
* mark deprecated methods and methods of deprecated classes in all backends
* render deprecation in warnings for asciidoc and plaintext backends
* extend backend tests for deprecation
use Doc.tags(tagname) instead of scanning Doc.tags()
@sdaschner sdaschner merged commit 8bda450 into sdaschner:master Jan 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants