Service Virtualization Feature enhancement#196
Service Virtualization Feature enhancement#196wing328 merged 59 commits intoOpenAPITools:masterfrom elans3:master
Conversation
Open Virtualan API Implementation
Menu change
Supporting files for Virtual service setup
…rator # Conflicts: # modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java
|
Sorry to ask stupid question, but how does this project is related to @wing328: maybe we could publish it as a new project inside the https://github.com/OpenAPITools organization? @elans3 What do you think about this proposition? Can you give me more details? |
|
Reason would be - Virtualized service had developed using the Open API Code generation project with openapi-generator-cli CLI tool. Refer the codegen files that would generate as "Virtualized" service.
Automated API Testing.
|
- Maven plugin related changes - Samples added
Virtual service Changes
Build issue resolved - Tab space was removed..
virtualan-plugin integration with open api tool.
|
Virtualan had released under io.virtualan.virtualan-plugin with 1.0.0. I had integrated the Open API Tools with Spring boot apps with Virtualan. Now it is available via https://oss.sonatype.org/content/repositories/releases/io/virtualan/virtualan-plugin/1.0.0 - the first version of virtualan.. |
|
Where is the repository holding the sources? Why are you not hosting your released jar on maven central? |
|
Yes it is available in the maven repo. https://repo.maven.apache.org/maven2/io/virtualan/virtualan-plugin/ |
| "artifactId": "springboot-virtualan", | ||
| "library": "spring-boot", | ||
| "virtualService": true, | ||
| "modelPackage" : "org.openapitools.virtualan.model", |
There was a problem hiding this comment.
Minor suggestion: use spaces instead of tab
There was a problem hiding this comment.
Removed the tab spaces
| public static final String GENERATE_MODEL_DOCS = "generateModelDocs"; | ||
|
|
||
| public static final String VIRTUAL_SERVICE = "virtualService"; | ||
| public static final String VIRTUAL_SERVICE_DOCS = "virtualServiceDocs"; |
There was a problem hiding this comment.
minor suggestion: I would suggest replace with virtualServiceDocs with a better description of the service
| cliOptions.add(CliOption.newBoolean(ASYNC, "use async Callable controllers", async)); | ||
| cliOptions.add(CliOption.newBoolean(REACTIVE, "wrap responses in Mono/Flux Reactor types (spring-boot only)", reactive)); | ||
| cliOptions.add(new CliOption(RESPONSE_WRAPPER, "wrap the responses in given type (Future,Callable,CompletableFuture,ListenableFuture,DeferredResult,HystrixCommand,RxObservable,RxSingle or fully qualified type)")); | ||
| cliOptions.add(CliOption.newBoolean(VIRTUAL_SERVICE, "Default generate without virtual service")); |
There was a problem hiding this comment.
I would suggest adding "https://github.com/elan-venture/virtualan/wiki" to explain the virtual service
e.g. "use virtual service: https://github.com/elan-venture/virtualan/wiki"
There was a problem hiding this comment.
Updated with Wiki reference.
| <version>1.5.9.RELEASE</version> | ||
| </dependency> | ||
| <!-- END Virtual Service API support --> | ||
| {{/virtualService}} |
There was a problem hiding this comment.
To make it consistent with the rest of the pom file, please use spaces instead of tabs
There was a problem hiding this comment.
Removed the Tab spaces
Latest changes
Updated the all review comments and removed all tab spaces.
|
@elans3 I ran --- a/samples/server/petstore/springboot-virtualan/README.md
+++ b/samples/server/petstore/springboot-virtualan/README.md
@@ -1,29 +1,18 @@
# OpenAPI generated server
-Spring Boot Virtual API Service using Virtulan: https://github.com/elan-venture/virtualan/wiki
+Spring Boot Server
## Overview
-This virtual service was generated by the [OpenAPI Generator](https://openapi-generator.tech) project.
-By using the [OpenAPI-Spec](https://openapis.org), you can easily generate a virtual service.
-This is an example of building a OpenAPI-enabled virtual service in Java using the SpringBoot framework.
+This server was generated by the [OpenAPI Generator](https://openapi-generator.tech) project.
+By using the [OpenAPI-Spec](https://openapis.org), you can easily generate a server stub.
+This is an example of building a OpenAPI-enabled server in Java using the SpringBoot framework.
-The underlying library integrating OpenAPI to SpringBoot is [springfox](https://github.com/springfox/springfox) and Virtualan (https://github.com/elan-venture/virtualan)
+The underlying library integrating OpenAPI to SpringBoot is [springfox](https://github.com/springfox/springfox)
-Build:
+Start your server as a simple java application
- mvn clean install
+You can view the api documentation in swagger-ui by pointing to
+http://localhost:80/
-Run using standalone JAR:
-
- java -jar target/virtualan-spring-controller-example-1.0.0.jar
-
-Invoke User REST service:
-
- curl http://localhost/users
-
-Invoke Virtualan UI:
-
-Navigate to http://localhost/virtualan-ui.html.
-
-More details about the user interface refer- https://github.com/elan-venture/virtualan/wiki
\ No newline at end of file
+Change default port value in application.properties
\ No newline at end of fileLooks like all the Virtualan related information are gone. Did you see similar update when running the script locally? |
Updated the ReadMe section.
|
@wing328.. Updated the code to generate the "README.md" including Virtualan information on the fly. |
New line removed to fix the build issue. :)
Virtualan included in the petstore build script
|
@elans3 thanks for the quick fix. The change looks good to me. |
|
@wing328.. Thank you!!! |
|
@elans3 thanks again for the PR, which is included in the v3.3.0 minor release: https://twitter.com/oas_generator/status/1046941449609068544 |
|
Thank you!!! |
* Open Virtualan API Implementation * Menu change * Delete .swagger-codegen-ignore * Delete jsonbeautifier.html * Supporting files for Virtual service setup * CRLF removed * Unwanted new lines are removed * Build issues resolved * Build issue resolved * Removed Logger statement * Logger removed * Updated * Codegen virtual services samples for petstore.yaml * - Code Revamp and Clean up - Maven plugin related changes - Samples added * Tab space removed.. * Annotation based Service virtualization * Open API code generator changes * Virtualan samples added with Sprint boot app. * Build issue resolved * Removed unwanted files * Updated with version 3.0.3 SNAPSHOT * Reverted the options for virtual service in global and not needed now. * virtualan-plugin integration with open api tool. * Updated the all review comments and removed all tab spaces. * Updated the ReadMe generator section. * New line removed to fix the build issue. * Spring boot virtualan included in the spring build script * Included in the spring-all-petstore script
I am one of the swagger/Open API user and would like to be a future contributor to the community. I had started developing a virtualized service idea and donate the code to Swagger community from the beginning.
How can we use codegen project into Service Virtualization, As it holds tremendous potential to help testers boost test automation and keep pace with Agile and DevOps demands. If Developer/Tester being pressured to test faster and/or earlier in each release cycle (e.g., “shift left”), Service Virtualization could help advance development team’s Continuous Testing and development efforts and lot more in the API Contract driven world"
I have been working on project and had a requirement to develop a virtualized service. I had customized swagger codegen to create a virtualized service generation for the any given REST Yaml contract with JSON support.
How to setup virtualized service for all your Rest contracts in less then 10 minutes...
Required Info:
https://github.com/elans3/openapi-generator/blob/master/modules/openapi-generator-virtualan/src/main/resources/java-config.json
Setup Instruction: (All steps are same used as Swagger codegen as reference)
https://virtualmockservice.blogspot.com/2018/04/hi-everyone-in-this-microservice-world.html
Please let me know if you need any additional details. I would be eager to help integrate with codegen project.
Thanks,
Elan