Browse Source

Automatic Commit By liuyuqi

liuyuqi-dellpc 1 year ago
parent
commit
d4eda94600
6 changed files with 91 additions and 1 deletions
  1. 25 0
      .dockerignore
  2. 9 0
      Dockerfile
  3. 24 1
      README.md
  4. 19 0
      docker-compose.yml
  5. 11 0
      package.json
  6. 3 0
      run.ts

+ 25 - 0
.dockerignore

@@ -0,0 +1,25 @@
+**/.classpath
+**/.dockerignore
+**/.env
+**/.git
+**/.gitignore
+**/.project
+**/.settings
+**/.toolstarget
+**/.vs
+**/.vscode
+**/*.*proj.user
+**/*.dbmdl
+**/*.jfm
+**/bin
+**/charts
+**/docker-compose*
+**/compose*
+**/Dockerfile*
+**/node_modules
+**/npm-debug.log
+**/obj
+**/secrets.dev.yaml
+**/values.dev.yaml
+LICENSE
+README.md

+ 9 - 0
Dockerfile

@@ -0,0 +1,9 @@
+FROM node:21-alpine
+WORKDIR /app
+VOLUME [ "/app" ]
+# ENV key=value
+RUN npm i postman-to-openapi -g
+# COPY source dest
+# EXPOSE port
+CMD [ "node", "run.ts" ]
+ENTRYPOINT [ "postman-to-openapi" ]

+ 24 - 1
README.md

@@ -1,3 +1,26 @@
 # postman-to-openapi
 # postman-to-openapi
 
 
-postman-to-openapi
+postman format to openapi format.
+
+## Usage
+
+postman to openapi:
+```
+docker compose up -d
+```
+
+openapi to postman:
+
+login postman website, then import the openapi file.
+
+## Reference
+
+https://editor-next.swagger.io/
+
+https://editor.swagger.io/
+
+https://file.yoqi.me/openapi-gui/
+
+
+## License
+

+ 19 - 0
docker-compose.yml

@@ -0,0 +1,19 @@
+version: '3.4'
+
+services:
+  postmantoopenapi:
+    container_name: postmantoopenapi
+    image: jianboy/postmantoopenapi:latest
+    build:
+      context: .
+      dockerfile: ./Dockerfile
+    environment: # - name=value
+    ports:
+      - 3000:3000
+    command:
+      [
+        "npm",
+        "run",
+        "start"
+      ]
+    working_dir: /app

+ 11 - 0
package.json

@@ -0,0 +1,11 @@
+{
+  "name": "postman-to-openapi",
+  "version": "1.0.0",
+  "description": "postman format to openapi format.",
+  "main": "index.js",
+  "scripts": {
+    "start": "node run.ts",
+  },
+  "author": "",
+  "license": "ISC"
+}

+ 3 - 0
run.ts

@@ -0,0 +1,3 @@
+// 1. find *.json and run:
+// run p2o ./shop.postman_collection.json -f ./shop.yaml
+