Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[C] better support for additional properties #4349

Merged
merged 3 commits into from
Nov 27, 2019

Conversation

michelealbano
Copy link
Contributor

Solved #4289

PR checklist

  • [ X ] Read the contribution guidelines.
  • [ X ] If contributing template-only or documentation-only changes which will change sample output, build the project before.
  • [ X ] Run the shell script(s) under ./bin/ (or Windows batch scripts under.\bin\windows) to update Petstore samples related to your fix. This is important, as CI jobs will verify all generator outputs of your HEAD commit, and these must match the expectations made by your contribution. You only need to run ./bin/{LANG}-petstore.sh, ./bin/openapi3/{LANG}-petstore.sh if updating the code or mustache templates for a language ({LANG}) (e.g. php, ruby, python, etc).
  • [ X ] File the PR against the correct branch: master, 4.1.x, 5.0.x. Default: master.
  • Copy the technical committee to review the pull request if your PR is targeting a particular programming language.


##set header files
#set(HDRS
#)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@michelealbano seems like these will disable the integration tests for the C Petstore client. I could no longer find the following in the Travis log:

-- Build files have been written to: /home/travis/build/OpenAPITools/openapi-generator/samples/client/petstore/c
Scanning dependencies of target openapi_petstore
[  4%] Building C object CMakeFiles/openapi_petstore.dir/src/list.c.o
[  8%] Building C object CMakeFiles/openapi_petstore.dir/src/apiKey.c.o
[ 12%] Building C object CMakeFiles/openapi_petstore.dir/src/apiClient.c.o
[ 16%] Building C object CMakeFiles/openapi_petstore.dir/external/cJSON.c.o
[ 20%] Building C object CMakeFiles/openapi_petstore.dir/model/api_response.c.o
[ 25%] Building C object CMakeFiles/openapi_petstore.dir/model/category.c.o
[ 29%] Building C object CMakeFiles/openapi_petstore.dir/model/order.c.o
[ 33%] Building C object CMakeFiles/openapi_petstore.dir/model/pet.c.o
[ 37%] Building C object CMakeFiles/openapi_petstore.dir/model/tag.c.o
[ 41%] Building C object CMakeFiles/openapi_petstore.dir/model/user.c.o
[ 45%] Building C object CMakeFiles/openapi_petstore.dir/api/PetAPI.c.o
[ 50%] Building C object CMakeFiles/openapi_petstore.dir/api/StoreAPI.c.o
[ 54%] Building C object CMakeFiles/openapi_petstore.dir/api/UserAPI.c.o
[ 58%] Linking C shared library libopenapi_petstore.so
[ 58%] Built target openapi_petstore
Scanning dependencies of target unit-manual-PetAPI
[ 62%] Building C object CMakeFiles/unit-manual-PetAPI.dir/unit-tests/manual-PetAPI.c.o
[ 66%] Linking C executable unit-manual-PetAPI
[ 66%] Built target unit-manual-PetAPI
Scanning dependencies of target unit-manual-UserAPI
[ 70%] Building C object CMakeFiles/unit-manual-UserAPI.dir/unit-tests/manual-UserAPI.c.o
[ 75%] Linking C executable unit-manual-UserAPI
[ 75%] Built target unit-manual-UserAPI
Scanning dependencies of target unit-manual-StoreAPI
[ 79%] Building C object CMakeFiles/unit-manual-StoreAPI.dir/unit-tests/manual-StoreAPI.c.o
[ 83%] Linking C executable unit-manual-StoreAPI
[ 83%] Built target unit-manual-StoreAPI
Scanning dependencies of target unit-manual-user
[ 87%] Building C object CMakeFiles/unit-manual-user.dir/unit-tests/manual-user.c.o
[ 91%] Linking C executable unit-manual-user
[ 91%] Built target unit-manual-user
Scanning dependencies of target unit-manual-order
[ 95%] Building C object CMakeFiles/unit-manual-order.dir/unit-tests/manual-order.c.o
[100%] Linking C executable unit-manual-order
[100%] Built target unit-manual-order
Data is:{
	"id":	1234,
	"category":	{
		"id":	5,
		"name":	"Example Category"
	},
	"name":	"Example Pet",
	"photoUrls":	["http://www.github.com", "http://www.gitter.im"],
	"tags":	[{
			"id":	1,
			"name":	"beautiful code"
		}, {
			"id":	542353,
			"name":	"at least I tried"
		}],
	"status":	"available"
}
successful operation
Data is:{
	"id":	1234,
	"category":	{
		"id":	5,
		"name":	"Example Category"
	},
	"name":	"Rocky Handsome",
	"photoUrls":	["http://www.github.com", "http://www.gitter.im"],
	"tags":	[{
			"id":	1,
			"name":	"beautiful code"
		}, {
			"id":	542353,
			"name":	"at least I tried"
		}],
	"status":	"sold"
}
successful operation
User is: 
{
	"id":	1234,
	"username":	"example123",
	"firstName":	"Example1",
	"lastName":	"Example2Last",
	"email":	"example@example.com",
	"password":	"thisisexample!123",
	"phone":	"+123456789",
	"userStatus":	4
}
successful operation
Login User: logged in user session:1572762309163
successful operation
Placed order: 
{
	"id":	1234,
	"petId":	12345,
	"quantity":	50,
	"shipDate":	"2018-09-24T10:19:09.592+0000",
	"status":	"placed",
	"complete":	true
}
successful operation
Order received: 
{
	"id":	1234,
	"petId":	12345,
	"quantity":	50,
	"shipDate":	"2018-09-24T10:19:09.592+0000",
	"status":	"placed",
	"complete":	true
}
Order Deleted 
Order not found
successful operation
sold - 2
pending - 2
available - 9

Ref: https://travis-ci.org/OpenAPITools/openapi-generator/builds/606108932?utm_source=github_status&utm_medium=notification

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wing328 I just run ./bin/c-petstore.sh after the changes by @zhemant
Should we meet on Slack to decide how it should be?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zhemant I gave a look at the new c-petstore.sh, and I haven't the expertise to correct the issue raised by @wing328 . Can you help with solving it?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@michelealbano Sure, I think I already have an idea why this is happening. If you can talk on IM, then I can maybe tell you in details about how the working is. I had sent you text on gitter. I don't know if you use it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've filed #4457 with some minor enhancements, which should correct the skipped tests due to regenerating the CMakefile file

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@michelealbano can you please merge the latest master into this branch as I've merged #4457 into master?

@wing328
Copy link
Member

wing328 commented Nov 27, 2019

Successfully trigger build failure via https://travis-ci.org/OpenAPITools/openapi-generator/builds/617600938

I'll merge when all the tests pass

@wing328 wing328 merged commit 96c1bda into OpenAPITools:master Nov 27, 2019
@wing328 wing328 changed the title C additional properties fix #4289 [C] fix additional properties Nov 27, 2019
@wing328 wing328 changed the title [C] fix additional properties [C] better support for additional properties Nov 27, 2019
@wing328 wing328 added this to the 4.2.2 milestone Dec 2, 2019
@wing328
Copy link
Member

wing328 commented Dec 2, 2019

@michelealbano thanks for the PR, which has been included in the v4.2.2 release: https://twitter.com/oas_generator/status/1201432648544972800

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants