ext { swagger_version = "1.5.8" } dependencies { plugin 'io.swagger:swagger-codegen-cli:2.1.5' compile fileTree(dir: 'vendor', include: '*.jar', exclude: '*-sources.jar') vendor 'com.google.guava:guava:19.0' vendor 'com.google.guava:guava:19.0:sources' vendor 'org.apache.commons:commons-lang3:3.4' vendor "io.swagger:swagger-annotations:${swagger_version}" vendor "io.swagger:swagger-annotations:${swagger_version}:sources" vendor "io.swagger:swagger-core:${swagger_version}" vendor "io.swagger:swagger-core:${swagger_version}:sources" vendor "io.swagger:swagger-models:${swagger_version}" vendor "io.swagger:swagger-models:${swagger_version}:sources" vendor "io.swagger:swagger-parser:1.0.17" vendor "io.swagger:swagger-parser:1.0.17:sources" vendor 'org.antlr:stringtemplate:4.0.2' vendor 'org.antlr:stringtemplate:4.0.2:sources' } task swaggerToAsciidoc(type: JavaExec) { description 'Create asciidoc fragments from current Swagger definition' classpath = sourceSets.main.runtimeClasspath main = 'com.perforce.hws.swagger.GenerateAsciidoc' args file('src/docs/swagger/helix-web-services-2016.1.0.yaml').canonicalPath, file("${buildDir}/asciidoc").canonicalPath } task generateJavaClient(type: JavaExec) { description 'Regenerate the java client project' classpath = fileTree(dir: 'plugins', include: '*.jar', exclude: '*-sources.jar') main 'io.swagger.codegen.SwaggerCodegen' args 'generate', '-i', file('src/docs/swagger/helix-web-services-2016.1.0.yaml').canonicalPath, '-l', 'java', '-c', file('java_config.json').canonicalPath, '-o', file('../client-java').canonicalPath, '-t', file('templates/Java').canonicalPath, '--import-mappings', 'JobCommand=com.perforce.hwsclient.models.JobCommand,' + 'JobsCommand=com.perforce.hwsclient.models.JobsCommand' } task generateRubyClient(type: JavaExec) { description 'Regenerate the ruby client project' classpath = fileTree(dir: 'plugins', include: '*.jar', exclude: '*-sources.jar') main 'io.swagger.codegen.SwaggerCodegen' args 'generate', '-i', file('src/docs/swagger/helix-web-services-2016.1.0.yaml').canonicalPath, '-t', file('templates/ruby').canonicalPath, '-l', 'ruby', '-c', file('ruby_config.json').canonicalPath, '-o', file('../client-ruby').canonicalPath, '--import-mappings', 'JobCommand=HelixWebServices::JobCommand,' + 'JobsCommand=HelixWebServices::JobsCommand' } task generatePHPClient(type: JavaExec) { description 'Regenerate the PHP client project' classpath = fileTree(dir: 'plugins', include: '*.jar', exclude: '*-sources.jar') main 'io.swagger.codegen.SwaggerCodegen' args 'generate', '-i', file('src/docs/swagger/helix-web-services-2016.1.0.yaml').canonicalPath, '-t', file('templates/php').canonicalPath, '-l', 'php', '-c', file('php_config.json').canonicalPath, '-o', file('../client-php').canonicalPath, '--import-mappings', 'CommandResponse=HelixWebServices\\CommandResponse,' + 'JobCommand=HelixWebServices\\JobCommand,' + 'JobsCommand=HelixWebServices\\JobsCommand' } task generatePythonClient(type: JavaExec) { description 'Regenerate the Python client project' classpath = fileTree(dir: 'plugins', include: '*.jar', exclude: '*-sources.jar') main 'io.swagger.codegen.SwaggerCodegen' args 'generate', '-i', file('src/docs/swagger/helix-web-services-2016.1.0.yaml').canonicalPath, '-t', file('templates/python').canonicalPath, '-l', 'python', '-c', file('python_config.json').canonicalPath, '-o', file('../client-python').canonicalPath, '--import-mappings', 'JobCommand=helix_web_services_client.models.JobCommand,' + 'JobsCommand=helix_web_services_client.models.JobsCommand' } task generateJavaScriptClient(type: JavaExec) { description = 'Regenerate the JavaScript client project' classpath = sourceSets.main.runtimeClasspath main 'com.perforce.hws.swagger.GenerateJavaScriptClient' args "${project.projectDir}/src/docs/swagger/helix-web-services-2016.1.0.yaml", "${project.projectDir}/../client-javascript" } task generateAll { description "Regenerate all 2016.1.0 client libraries" dependsOn generateJavaClient, generateRubyClient, generatePHPClient, generatePythonClient, generateJavaScriptClient } task javaConfigHelp(type: JavaExec) { description 'Print help statement for Java configuration' classpath = fileTree(dir: 'plugins', include: '*.jar', exclude: '*-sources.jar') main 'io.swagger.codegen.SwaggerCodegen' args 'config-help', '-l', 'java' } task rubyConfigHelp(type: JavaExec) { description 'Print help statement for Ruby configuration' classpath = fileTree(dir: 'plugins', include: '*.jar', exclude: '*-sources.jar') main 'io.swagger.codegen.SwaggerCodegen' args 'config-help', '-l', 'ruby' } task phpConfigHelp(type: JavaExec) { description 'Print help statement for PHP configuration' classpath = fileTree(dir: 'plugins', include: '*.jar', exclude: '*-sources.jar') main 'io.swagger.codegen.SwaggerCodegen' args 'config-help', '-l', 'php' } task pythonConfigHelp(type: JavaExec) { description 'Print help statement for Python configuration' classpath = fileTree(dir: 'plugins', include: '*.jar', exclude: '*-sources.jar') main 'io.swagger.codegen.SwaggerCodegen' args 'config-help', '-l', 'python' } task swaggerJar(type: Jar) { description "Swagger jar distribution (for inclusion into the server as static data)" baseName = 'helix-web-services-swagger' from "src/docs/swagger" into 'publicsite/api/doc-swagger' }
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#35 | 19634 | swellard | Swagger codegen - fix equals | ||
#34 | 19553 | swellard | Move and rename clients | ||
#33 | 19545 | tjuricek | Add gradle task generateAll to regenerate all client sdk APIs, and generateJavaScriptClient to rebuild the JavaScript SDK. | ||
#32 | 19535 | drobins | Refactor package names to hws | ||
#31 | 19307 | tjuricek |
Python Client SDK tests from counters to users Need to treat the job-related models as UserDict instances, which involves some adjustments to the Swagger code generators. |
||
#30 | 19272 | tjuricek |
Python Client SDK test for branches, changes, clients, and commands. Just altered how arrays in query parameters are represented to the server to be consistent with the other clients. |
||
#29 | 19255 | tjuricek |
Change, client, command tests for PHP Client SDK. Changed how array-like query parameters were passed to the server to be consistent with other SDKs. |
||
#28 | 19237 | tjuricek |
Branch specs test for PHP Client SDK The default template didn't check isset(), so added that to the constructor initialization on models. |
||
#27 | 19198 | tjuricek |
Ruby Client SDK tests, from branches to jobs. Submitting since I've had to alter the Ruby swagger templates, and I want to make sure I haven't lost something. |
||
#26 | 19012 | tjuricek | Revised Java client SDK, added ApiClient reference, restructured documentation. | ||
#25 | 18924 | tjuricek |
First cut at including the Java client SDK docs as part of the main guide. This includes a new "object model" that knows how to generally convert to the different Java types, which greatly simplifies the templating logic. The final result is likely going to need some real ironing out. I'm going to basically get things wired up, and iterate on overall format and styling once all languages are represented. |
||
#24 | 18879 | tjuricek |
Add '-m' and '-a' filtering options on user list. Also, the Ruby client SDK needed to override the .gemspec template. |
||
#23 | 18818 | tjuricek | Python Client SDK for Helix Web Services | ||
#22 | 18811 | tjuricek | Initial PHP client SDK for Helix Web Services. | ||
#21 | 18810 | tjuricek |
First-pass at JavaScript client SDK. JavaScript requires Node with Gulp to "browserfy" the library. It's the easiest way I found to use the swagger-js project; bundle up a wrapping method. There is no JavaScript reference guide. The swagger-js doesn't really document what they do very well, actually. Overall I'm not particularly impressed by swagger-js, it was hard to even figure out what the right method syntax was. We may want to invest time in doing it better. This required setting CORS response headers, which are currently defaulted to a fairly insecure setting. |
||
#20 | 18795 | tjuricek | Use point-release versioning for the client SDKs and installers. | ||
#19 | 18785 | tjuricek | Revise the git fusion repository models. | ||
#18 | 18768 | tjuricek | Convert depot-related methods, and change the "listing" resource to a "paths" resource, and maybe help simplify the Location concept. | ||
#17 | 18766 | tjuricek | Convert trigger-related models. | ||
#16 | 18757 | tjuricek | Convert server-related models. | ||
#15 | 18746 | tjuricek | Convert protections-related models, along with updating documentation around login and projects. | ||
#14 | 18738 | tjuricek | Convert label-related models. | ||
#13 | 18732 | tjuricek | Convert job-related models. | ||
#12 | 18727 | tjuricek | Convert the status method to be part of the documented API, and convert the login-related models. | ||
#11 | 18726 | tjuricek |
Revise group models to mirror command output. I noticed the property capitalization wasn't following conventions for users, so I changed that here as well. |
||
#10 | 18722 | tjuricek | Convert user-related models to be command-oriented. | ||
#9 | 18713 | tjuricek | Converted counter related models. | ||
#8 | 18710 | tjuricek |
Convert change-related command models to our client API models, also, complete the "alpha" tagging of methods. This consolidates models related to creating changelists to come from the Java client SDK version. We are now tagging various methods as "alpha" to signify they may break in upcoming versions. This allows new features to have a period where they can be available, but not necessarily need to be supported in upcoming releases. |
||
#7 | 18700 | tjuricek |
Convert branch-related models, which includes CommandResponse, and framework for doing model conversion to/from our P4Java input maps. Dates are fun. Those are now being converted using the "tzoffset" from the server query. |
||
#6 | 18693 | tjuricek |
Move from swagger2markdown project to custom asciidoc generator. This gives us flexibility to do include the context path, for example, or alter the output fairly easily. While StringTemplate is a little tricky to get to know, it works pretty well for our needs, and offers a lot more flexibility for reorganization later. Note: I might change the status method to be version-specific, but in the future, we'll have a method "what versions do you support" which will *not* be version-specific. |
||
#5 | 18679 | tjuricek |
Revising HWS paths to work primarily at product version 2016.1. The swagger definitions will primarily work at a major platform release number. We will generate new clients for each major release, and ensure backwards compatibility as time goes on by keeping the older clients around in the tree. Note: These are JUST URLs, and do not include other revisions we plan on making shortly. |
||
#4 | 18551 | tjuricek |
Switch to using swagger-based HTTP methods. Remove old java_client. The swagger documentation generates asciidoc, which is included in the current user guide. We lose some control over the formatting. |
||
#3 | 18515 | tjuricek |
Replacing java_client with Swagger-based clients/java project. - Switched implementations of the Swagger client to use okhttp with gson. - Added the version to the "status" method, and hey, added that method to the spec - Added templates to the java code generator to add some default methods, fixing some import issues in Gradle NOTE: We may want to break down the API a bit and restructure it. |
||
#2 | 18489 | tjuricek | Add the swagger-generated ruby client. | ||
#1 | 18488 | tjuricek |
Swagger Java client (initial version). This contains a basic configuration for the java client, which mostly decides package location, etc. Notably, the license must be ASL under the SmartBear copyright. |