File tree Expand file tree Collapse file tree 8 files changed +43
-21
lines changed Expand file tree Collapse file tree 8 files changed +43
-21
lines changed Original file line number Diff line number Diff line change 1
- oai
1
+ oas
2
2
===
3
3
4
- Creating Swagger / Open API Initiative files is hard. This makes it easier.
4
+ Creating Swagger / Open API Spec files is hard. This makes it easier.
5
5
6
6
[ ![ ] ( https://cl.ly/1h271F1M1e2T/Untitled-2.png )] ( http://readme.io )
7
7
8
8
Installation
9
9
------------
10
10
11
- npm install oai -g
11
+ npm install oas -g
12
12
13
13
Usage
14
14
-----
15
15
16
16
Go to a directory with your API, and type:
17
17
18
- oai init
18
+ oas init
19
19
20
20
It will walk you through how to document your API with Open API Initiave.
21
21
22
22
Swagger Inline
23
23
--------------
24
24
25
- Rather than trying to juggle one gigantic repo, ` oai ` uses something called
25
+ Rather than trying to juggle one gigantic repo, ` oas ` uses something called
26
26
[ swagger-inline] ( https://github.com/readmeio/swagger-inline ) . It lets you include
27
27
a little swagger snippet in a comment above your code, and collects them all
28
28
together into one Swagger file:
@@ -54,7 +54,7 @@ Host your Swagger file
54
54
Hosting Swagger files is hard! So, we have an online component that hosts your
55
55
Swagger file for you. Just type the following to get a URL:
56
56
57
- oai host
57
+ oas host
58
58
59
59
This will upload your Swagger file and give you a URL you can use.
60
60
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ exports.api = function(args, opts) {
31
31
info . token = login . token ;
32
32
} catch ( e ) {
33
33
console . log ( 'You need to log in to do this!' . red ) ;
34
- console . log ( 'Run ' + 'oai login' . yellow ) ;
34
+ console . log ( 'Run ' + 'oas login' . yellow ) ;
35
35
return process . exit ( ) ;
36
36
}
37
37
}
@@ -110,7 +110,7 @@ exports.load = function(action) {
110
110
}
111
111
112
112
console . log ( 'Action not found.' . red ) ;
113
- console . log ( 'Type ' + 'oai help' . yellow + ' to see all commands' ) ;
113
+ console . log ( 'Type ' + 'oas help' . yellow + ' to see all commands' ) ;
114
114
process . exit ( ) ;
115
115
} ;
116
116
Original file line number Diff line number Diff line change
1
+ var utils = require ( '../utils' ) ;
2
+
3
+ exports . swagger = true ;
4
+ exports . swaggerUrl = true ;
5
+ exports . login = true ;
6
+ exports . desc = "Host your docs on ReadMe" ;
7
+ exports . category = "services" ;
8
+
9
+ exports . run = function ( config , info ) {
10
+ console . log ( "" ) ;
11
+ console . log ( "Success! " . green + "You can now access your Swagger from the following publicly sharable URL:" ) ;
12
+ console . log ( "" ) ;
13
+ console . log ( " " + info . swaggerUrl + "?docs" ) ;
14
+ console . log ( "" ) ;
15
+ console . log ( "To use in ReadMe for documentation, follow the URL for setup information." ) ;
16
+
17
+ utils . open ( info . swaggerUrl + "?docs" , info ) ;
18
+
19
+ process . exit ( ) ;
20
+ } ;
Original file line number Diff line number Diff line change @@ -5,12 +5,12 @@ var _ = require('lodash');
5
5
exports . swagger = false ;
6
6
exports . login = false ;
7
7
exports . category = "basic" ;
8
- exports . desc = "Learn what you can do with oai " ;
8
+ exports . desc = "Learn what you can do with oas " ;
9
9
exports . weight = 2 ;
10
10
11
11
exports . run = function ( config , info ) {
12
12
console . log ( "" ) ;
13
- console . log ( "Usage: oai <command> [swagger url]" ) ;
13
+ console . log ( "Usage: oas <command> [swagger url]" ) ;
14
14
var files = glob . sync ( path . join ( __dirname , "*" ) ) ;
15
15
16
16
var categories = {
@@ -35,7 +35,7 @@ exports.run = function(config, info) {
35
35
36
36
if ( f . category ) {
37
37
categories [ f . category ] . commands . push ( {
38
- text : " $" . grey + pad ( " oai " + action ) + " " + info . grey ,
38
+ text : " $" . grey + pad ( " oas " + action ) + " " + info . grey ,
39
39
weight : f . weight ,
40
40
} ) ;
41
41
}
@@ -51,7 +51,7 @@ exports.run = function(config, info) {
51
51
52
52
console . log ( "" ) ;
53
53
console . log ( "Just getting started?" . green ) ;
54
- console . log ( "Run " + "oai init" . yellow + " to create your Swagger file." ) ;
54
+ console . log ( "Run " + "oas init" . yellow + " to create your Swagger file." ) ;
55
55
console . log ( "" ) ;
56
56
57
57
process . exit ( ) ;
Original file line number Diff line number Diff line change @@ -151,9 +151,9 @@ exports.run = function(config, info) {
151
151
console . log ( '' ) ;
152
152
console . log ( 'For more information on this syntax, see https://github.com/readmeio/swagger-inline' ) ;
153
153
console . log ( '' ) ;
154
- console . log ( 'To see what you can do with your API, type ' + 'oai help' . yellow + '.' ) ;
154
+ console . log ( 'To see what you can do with your API, type ' + 'oas help' . yellow + '.' ) ;
155
155
console . log ( '' ) ;
156
- console . log ( 'To publish your OAI file, type ' + 'oai host' . yellow + '!' ) ;
156
+ console . log ( 'To publish your OAS file, type ' + 'oas host' . yellow + '!' ) ;
157
157
console . log ( '' ) ;
158
158
159
159
process . exit ( ) ;
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ exports.run = function(config, info) {
12
12
console . log ( "GRANT PUSH ACCESS" . cyan ) ;
13
13
console . log ( "Run the following command to add them (must match their GitHub email):" ) ;
14
14
console . log ( "" ) ;
15
- console . log ( " $ oai add user@email.com" . grey ) ;
15
+ console . log ( " $ oas add user@email.com" . grey ) ;
16
16
console . log ( "" ) ;
17
17
console . log ( "" ) ;
18
18
Original file line number Diff line number Diff line change 1
1
{
2
2
"author" : " ReadMe <support@readme.io> (http://readme.io)" ,
3
- "name" : " oai " ,
3
+ "name" : " oas " ,
4
4
"description" : " A collection of Open API Initiative (Swagger) tools" ,
5
5
"bin" : {
6
- "oai " : " index.js"
6
+ "oas " : " index.js"
7
7
},
8
8
"tags" : [
9
9
" api" ,
10
10
" apis" ,
11
11
" swagger" ,
12
12
" open api initiative" ,
13
+ " open api spec" ,
13
14
" oai" ,
15
+ " oas" ,
14
16
" apidoc" ,
15
17
" microservice" ,
16
18
" documentation"
17
19
],
18
- "version" : " 0.6.1 " ,
20
+ "version" : " 0.6.2 " ,
19
21
"repository" : {
20
22
"type" : " git" ,
21
- "url" : " git://github.com/readmeio/oai .git"
23
+ "url" : " git://github.com/readmeio/oas .git"
22
24
},
23
25
"bugs" : {
24
- "url" : " https://github.com/readmeio/oai /issues"
26
+ "url" : " https://github.com/readmeio/oas /issues"
25
27
},
26
28
"main" : " index.js" ,
27
29
"dependencies" : {
Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ exports.findSwagger = function(cb, opts) {
33
33
34
34
if ( ! generatedSwagger [ 'x-si-base' ] ) {
35
35
console . log ( "We couldn't find a Swagger file." . red ) ;
36
- console . log ( "Run " + "oai init" . yellow + " to get started." ) ;
36
+ console . log ( "Don't worry, it's easy to get started! Run " + "oas init" . yellow + " to get started." ) ;
37
37
process . exit ( ) ;
38
38
}
39
39
You can’t perform that action at this time.
0 commit comments