Skip to content

Commit

Permalink
Use openapi-generator to generate go-server code
Browse files Browse the repository at this point in the history
Signed-off-by: Prasad Ghangal <[email protected]>
  • Loading branch information
PrasadG193 committed Dec 24, 2019
1 parent 9f7562f commit 9c32bf5
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 509 deletions.
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
codegen:
@build/codegen.sh

10 changes: 10 additions & 0 deletions build/codegen.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

OUT_DIR="pkg"

echo 'Generating code with openapi-generator-cli'
docker run --rm -v ${PWD}:/local openapitools/openapi-generator-cli generate -i /local/protocol/botframework.json -o /local/${OUT_DIR} -g go -c /local/protocol/openapi-config.yaml

# Fix permissions
sudo find ${OUT_DIR} -type d -exec chmod 755 {} \;
sudo find ${OUT_DIR} -type f -exec chmod 664 {} \;
3 changes: 2 additions & 1 deletion swagger/ConnectorAPI.json → protocol/botframework.json
Original file line number Diff line number Diff line change
Expand Up @@ -2671,4 +2671,5 @@
"in": "header"
}
}
}
}

3 changes: 3 additions & 0 deletions protocol/openapi-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"modelPackage": "botbuilder"
}
Loading

0 comments on commit 9c32bf5

Please sign in to comment.