4 Commits

Author SHA1 Message Date
Nathan Baulch
9f1fa0e440
Fix another batch of spelling typos (#13915)
* Fix typos

* Remove repeated words

* Minor grammar fixes
2022-11-07 21:30:24 +08:00
Chao Yang
3f0f92fb65
[crystal][client] Make optional properties nillable in models (#10723)
* Add nillable data types to models

Only REQUIRED and NOT NULLABLE variables can NOT have type Nil
All OPTIONAL and NULLABLE-REQUIRED variables have type Nil
Only NULLABLE-REQUIRED variables should emit keys with null values when they are serialized, json example: property name : String? = nil; the json representation for this property is {"name": null}
For all OPTIONAL variables having Nil values, their variable keys would be skipped during serialization. The json representation for OPTIONAL property name : String? = nil;  would be: {}

* Fix failed tests in samples/client/petstore/crystal/spec/api/pet_api_spec.cr

* Remove isNullable from model template

* No need to check nillability of required property

For any required property, assigning nil value to it will result in compilation error
The datatype simply can not hold value nil, so there's no need to check it

* Place required vars first in initializor

* Refresh generated sample code for crystal client

* Required properties are not nillable

* Fix compilation error of undefined method equal?

Crystal lang doesn't have method equal?
We should use method same? instead of ruby's equal? method

Reference: https://crystal-lang.org/api/master/Reference.html#same?(other:Reference):Bool-instance-method

* Add tests for add_pet api endpoint with only required parameters

Setting Pet optional properties to nil values is allowed by add_pet api endpoint

* Add helper method to test compilation errors

* Add tests to Pet model

Test model initializations
Test compilation error when model is initialized without required properties

* Test required properties in json deserialization for Pet model
2022-01-29 10:55:44 +08:00
Yusuke Hosonuma
477926f008
[crystal][client] Support authorization (#9488)
* [crystal][client] support authorization header

* [crystal][client] update samples

* [crystal][client] update tests

* [crystal][client] add unit test for api_client.cr
2021-05-17 21:24:30 +08:00
William Cheng
1df719801e
Add a new crystal client generator (beta) (#8304)
* add crytsal client generator

* update samples

* update doc

* regenerate spec

* regenerate spec

* various fixes

* test crystal in circleci

* test crystal client in drone ci

* Revert "test crystal client in drone ci"

This reverts commit 317f2cf2a09f902c08ced214e8e5802fa79c3de8.

* fix install

* fix installation

* test crystal in travis

* cache image

* add --cache-from

* update doc

* run petstore with mvn

* install crystal

* fix install crystal

* sudo mvn

* run server

* using mvnw

* fix form or body parameter

* remove crystal from circleci

* fix test

* remove cache-from

* update doc
2021-01-07 17:10:22 +08:00