Commit 7547bfa
authored
Improve usability of switch port settings (#7966)
This PR aims to improve the usability of the switch port settings API by
returning data of similar shape and content as what users provide when
the create the switch port settings.
Issues resolved:
* Before this PR, you only need one call to create a complete switch
port settings object, but you have to perform several lookups to get the
complete switch port configuration. We were already returning the object
ids of the nested objects, so it makes a lot of sense to just return the
actual object (especially since the user supplied the entire object when
they configured it)
* The `HashMap<String_of_link_name, T>` pattern also did not give the
expected behavior in our go client generation. Changing this to a
`Vec<T_with_link_name_inside>` matches what the user provides during
creation and also resolves this behavior.
* Some of our `Vec<T>` fields can be empty but must be present. In the
Go client, an empty array is omitted from the json object. We needed to
add a `default` annotation to these fields so Serde handles this
situation correctly.
## Related
- oxidecomputer/oxide.go#278
- oxidecomputer/terraform-provider-oxide#426
Closes #57801 parent 80e9922 commit 7547bfa
File tree
13 files changed
+973
-458
lines changed- common/src/api/external
- nexus
- db-model/src
- db-queries/src/db/datastore
- db-schema/src
- external-api/src
- src
- app
- background/tasks
- external_api
- tests/integration_tests
- types/src/external_api
- openapi
13 files changed
+973
-458
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2466 | 2466 | | |
2467 | 2467 | | |
2468 | 2468 | | |
2469 | | - | |
| 2469 | + | |
2470 | 2470 | | |
2471 | 2471 | | |
2472 | 2472 | | |
| |||
2475 | 2475 | | |
2476 | 2476 | | |
2477 | 2477 | | |
2478 | | - | |
2479 | | - | |
2480 | | - | |
| 2478 | + | |
| 2479 | + | |
| 2480 | + | |
2481 | 2481 | | |
2482 | 2482 | | |
2483 | 2483 | | |
| |||
2488 | 2488 | | |
2489 | 2489 | | |
2490 | 2490 | | |
2491 | | - | |
2492 | | - | |
2493 | | - | |
2494 | | - | |
2495 | | - | |
2496 | | - | |
2497 | | - | |
2498 | 2491 | | |
2499 | 2492 | | |
2500 | 2493 | | |
| |||
2508 | 2501 | | |
2509 | 2502 | | |
2510 | 2503 | | |
2511 | | - | |
| 2504 | + | |
2512 | 2505 | | |
2513 | 2506 | | |
2514 | 2507 | | |
| |||
2633 | 2626 | | |
2634 | 2627 | | |
2635 | 2628 | | |
2636 | | - | |
2637 | | - | |
2638 | | - | |
2639 | | - | |
2640 | | - | |
2641 | | - | |
2642 | | - | |
2643 | 2629 | | |
2644 | 2630 | | |
2645 | 2631 | | |
| |||
2656 | 2642 | | |
2657 | 2643 | | |
2658 | 2644 | | |
| 2645 | + | |
| 2646 | + | |
| 2647 | + | |
| 2648 | + | |
| 2649 | + | |
| 2650 | + | |
| 2651 | + | |
2659 | 2652 | | |
2660 | 2653 | | |
2661 | 2654 | | |
| |||
2683 | 2676 | | |
2684 | 2677 | | |
2685 | 2678 | | |
2686 | | - | |
| 2679 | + | |
2687 | 2680 | | |
2688 | 2681 | | |
2689 | 2682 | | |
| |||
2746 | 2739 | | |
2747 | 2740 | | |
2748 | 2741 | | |
2749 | | - | |
2750 | | - | |
2751 | | - | |
2752 | | - | |
2753 | | - | |
2754 | | - | |
2755 | | - | |
2756 | | - | |
2757 | | - | |
2758 | | - | |
2759 | | - | |
2760 | | - | |
2761 | 2742 | | |
2762 | 2743 | | |
2763 | 2744 | | |
| |||
2825 | 2806 | | |
2826 | 2807 | | |
2827 | 2808 | | |
2828 | | - | |
| 2809 | + | |
2829 | 2810 | | |
2830 | 2811 | | |
2831 | 2812 | | |
| |||
2981 | 2962 | | |
2982 | 2963 | | |
2983 | 2964 | | |
| 2965 | + | |
| 2966 | + | |
| 2967 | + | |
| 2968 | + | |
| 2969 | + | |
| 2970 | + | |
| 2971 | + | |
| 2972 | + | |
| 2973 | + | |
| 2974 | + | |
| 2975 | + | |
| 2976 | + | |
| 2977 | + | |
| 2978 | + | |
| 2979 | + | |
| 2980 | + | |
| 2981 | + | |
| 2982 | + | |
| 2983 | + | |
| 2984 | + | |
| 2985 | + | |
| 2986 | + | |
| 2987 | + | |
| 2988 | + | |
| 2989 | + | |
| 2990 | + | |
| 2991 | + | |
2984 | 2992 | | |
2985 | 2993 | | |
2986 | 2994 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
50 | 72 | | |
51 | 73 | | |
52 | 74 | | |
| |||
286 | 308 | | |
287 | 309 | | |
288 | 310 | | |
289 | | - | |
290 | | - | |
291 | | - | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
292 | 314 | | |
293 | 315 | | |
294 | 316 | | |
| |||
407 | 429 | | |
408 | 430 | | |
409 | 431 | | |
410 | | - | |
411 | | - | |
412 | | - | |
413 | | - | |
414 | | - | |
415 | | - | |
416 | | - | |
417 | | - | |
418 | | - | |
419 | | - | |
420 | | - | |
421 | | - | |
422 | | - | |
423 | | - | |
424 | | - | |
425 | 432 | | |
426 | 433 | | |
427 | 434 | | |
| |||
486 | 493 | | |
487 | 494 | | |
488 | 495 | | |
489 | | - | |
| 496 | + | |
490 | 497 | | |
491 | 498 | | |
492 | 499 | | |
| |||
625 | 632 | | |
626 | 633 | | |
627 | 634 | | |
628 | | - | |
| 635 | + | |
629 | 636 | | |
630 | 637 | | |
631 | 638 | | |
| |||
0 commit comments