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

Fix as attribute path format #1080

Merged
merged 1 commit into from
Oct 3, 2024
Merged

Fix as attribute path format #1080

merged 1 commit into from
Oct 3, 2024

Conversation

juhaku
Copy link
Owner

@juhaku juhaku commented Oct 3, 2024

Prior to this commit the as attribute produced invalid path with line break within the name and some colons not being replaced. This commit will fix this where now as definition like following will get serialized correctly to JSON as shown below.

 #[derive(ToSchema)]
 #[schema(as = types::calculation::calculation_assembly_cost::v1::CalculationAssemblyCostResponse)]
 pub struct CalculationAssemblyCostResponse {
     #[schema(value_type = uuid::Uuid)]
     pub id: String,
 }

Will serialize to:

 "schema": {
     "$ref": "#/components/schemas/types.calculation.calculation_assembly_cost.v1.CalculationAssemblyCostResponse"
 },

Fixes #1019

@juhaku juhaku force-pushed the fix-as-path-format branch 2 times, most recently from 2156d5a to d45a869 Compare October 3, 2024 13:17
Prior to this commit the `as` attribute produced invalid path with line
break within the name and some colons not being replaced. This commit
will fix this where now as definition like following will get serialized
correctly to JSON as shown below.
```rust
 #[derive(ToSchema)]
 #[schema(as = types::calculation::calculation_assembly_cost::v1::CalculationAssemblyCostResponse)]
 pub struct CalculationAssemblyCostResponse {
     #[schema(value_type = uuid::Uuid)]
     pub id: String,
 }
```
Will serialize to:
```json
 "schema": {
     "$ref": "#/components/schemas/types.calculation.calculation_assembly_cost.v1.CalculationAssemblyCostResponse"
 },
```

Fixes #1019
@juhaku juhaku force-pushed the fix-as-path-format branch from d45a869 to 377e1bd Compare October 3, 2024 13:18
@juhaku juhaku merged commit 7dbfc63 into master Oct 3, 2024
22 checks passed
@juhaku juhaku deleted the fix-as-path-format branch October 3, 2024 13:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Released
Development

Successfully merging this pull request may close these issues.

Newline in generated reference URL
1 participant