0
0
Spring Bootframework~10 mins

Generating client code from spec in Spring Boot - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to generate a Spring Boot client from an OpenAPI spec using the CLI.

Spring Boot
openapi-generator-cli generate -i api.yaml -g [1] -o ./client
Drag options to blanks, or click blank then click option'
Apython
Bjava
Cspring
Dhtml
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'java' instead of 'spring' generates a plain Java client, not Spring Boot.
Using unrelated generators like 'python' or 'html' will not create a Spring Boot client.
2fill in blank
medium

Complete the code to add a library option for the Spring client generation.

Spring Boot
openapi-generator-cli generate -i api.yaml -g spring --library [1] -o ./client
Drag options to blanks, or click blank then click option'
Afeign
Bokhttp
Cresttemplate
Dretrofit
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing 'resttemplate' when the task expects Feign usage.
Using 'okhttp' or 'retrofit' which are not typical Spring Boot client libraries.
3fill in blank
hard

Fix the error in the command to generate a Spring client with the correct package name.

Spring Boot
openapi-generator-cli generate -i api.yaml -g spring --package-name [1] -o ./client
Drag options to blanks, or click blank then click option'
Acom.example client
Bcom-example-client
Ccom_example_client
Dcom.example.client
Attempts:
3 left
💡 Hint
Common Mistakes
Using dashes or spaces in package names causes errors.
Underscores are not standard in Java package names.
4fill in blank
hard

Fill both blanks to configure the generator to use a specific API and model package.

Spring Boot
openapi-generator-cli generate -i api.yaml -g spring --api-package [1] --model-package [2] -o ./client
Drag options to blanks, or click blank then click option'
Acom.example.api
Bcom.example.model
Ccom.example.service
Dcom.example.data
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up API and model package names.
Using unrelated package names that don't reflect API or model.
5fill in blank
hard

Fill all three blanks to generate a Spring client with a custom group ID, artifact ID, and version.

Spring Boot
openapi-generator-cli generate -i api.yaml -g spring --group-id [1] --artifact-id [2] --artifact-version [3] -o ./client
Drag options to blanks, or click blank then click option'
Acom.example
Bmy-client
C1.0.0
Dorg.sample
Attempts:
3 left
💡 Hint
Common Mistakes
Using invalid version formats.
Confusing group ID and artifact ID values.