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

Specify service name when importing artifact from OpenAPI2/3 contract #113

Closed
f-lopes opened this issue Dec 12, 2024 · 5 comments
Closed
Labels
component/runtime Runtime behavior of test container kind/question Further information is requested

Comments

@f-lopes
Copy link

f-lopes commented Dec 12, 2024

Is it possible (or at least will be in the future) to specify the service name when importing an artifact via the Java API?

https://github.com/microcks/microcks-testcontainers-java/blob/main/src/main/java/io/github/microcks/testcontainers/MicrocksContainer.java#L265

It would be especially useful when a contract.yaml uses a title with special characters (spaces, accents, etc.).

This way, the getRestMockEndpoint() method (https://github.com/microcks/microcks-testcontainers-java/blob/main/src/main/java/io/github/microcks/testcontainers/MicrocksContainer.java#L237) would return a properly formatted URL.

Thanks.

Copy link

👋 @f-lopes

Welcome to the Microcks community! 💖

Thanks and congrats 🎉 for opening your first issue here! Be sure to follow the issue template or please update it accordingly.

📢 If you're using Microcks in your organization, please add your company name to this list. 🙏 It really helps the project to gain momentum and credibility. It's a small contribution back to the project with a big impact.

If you need to know why and how to add yourself to the list, please read the blog post "Join the Microcks Adopters list and Empower the vibrant open source Community 🙌"

Hope you have a great time there!

🌟 ~~~~~~~~~ 🌟

📢 If you like Microcks, please ⭐ star ⭐ our repo to support it!

🙏 It really helps the project to gain momentum and credibility. It's a small contribution back to the project with a big impact.

@lbroudoux
Copy link
Member

Hey @f-lopes!

Special characters in API name or version are expected to be HTTP-encoded (at least, they are on Microcks core). Can you provide some examples that are not working on your side? Maybe we're not reproducing the same encoding on the library that what we're doing on server side...

@lbroudoux lbroudoux added kind/question Further information is requested component/runtime Runtime behavior of test container labels Dec 16, 2024
@f-lopes
Copy link
Author

f-lopes commented Dec 17, 2024

Hey @lbroudoux!

Thanks for your response.

I can't share the exact example that is not working on my side. However, when importing an artifact (OpenAPI v2) with a title containing both spaces and accents (for example, API permettant de gérer les pâtisseries), the microcksContainer.getRestMockEndpoint("API permettant de gérer les pâtisseries", "1.0.0") returns a URL containing the same title (meaning it is not encoded at all).

Isn't that endpoint URL expected to be encoded?

Thanks.

@lbroudoux
Copy link
Member

I'm afraid you're right and we screwed the encoding part. Let's fix this! I'm going to create another issue to track this bug.

@lbroudoux
Copy link
Member

#116 has been crated to track this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/runtime Runtime behavior of test container kind/question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants