File tree Expand file tree Collapse file tree 3 files changed +4
-26
lines changed Expand file tree Collapse file tree 3 files changed +4
-26
lines changed Original file line number Diff line number Diff line change @@ -868,6 +868,10 @@ export class RESTfulOpenAPIGenerator extends OpenAPIGeneratorBase {
868
868
const required : string [ ] = [ ] ;
869
869
870
870
for ( const field of fields ) {
871
+ if ( isForeignKeyField ( field ) && mode !== 'read' ) {
872
+ // foreign keys are not exposed as attributes
873
+ continue ;
874
+ }
871
875
if ( isRelationshipField ( field ) ) {
872
876
let relType : string ;
873
877
if ( mode === 'create' || mode === 'update' ) {
Original file line number Diff line number Diff line change @@ -2791,14 +2791,10 @@ components:
2791
2791
type : string
2792
2792
attributes :
2793
2793
type : object
2794
- required :
2795
- - userId
2796
2794
properties :
2797
2795
image :
2798
2796
type : string
2799
2797
nullable : true
2800
- userId :
2801
- type : string
2802
2798
relationships :
2803
2799
type : object
2804
2800
properties :
@@ -2830,8 +2826,6 @@ components:
2830
2826
image :
2831
2827
type : string
2832
2828
nullable : true
2833
- userId :
2834
- type : string
2835
2829
relationships :
2836
2830
type : object
2837
2831
properties :
@@ -2974,9 +2968,6 @@ components:
2974
2968
format : date-time
2975
2969
title :
2976
2970
type : string
2977
- authorId :
2978
- type : string
2979
- nullable : true
2980
2971
published :
2981
2972
type : boolean
2982
2973
viewCount :
@@ -3022,9 +3013,6 @@ components:
3022
3013
format : date-time
3023
3014
title :
3024
3015
type : string
3025
- authorId :
3026
- type : string
3027
- nullable : true
3028
3016
published :
3029
3017
type : boolean
3030
3018
viewCount :
Original file line number Diff line number Diff line change @@ -2797,15 +2797,11 @@ components:
2797
2797
type : string
2798
2798
attributes :
2799
2799
type : object
2800
- required :
2801
- - userId
2802
2800
properties :
2803
2801
image :
2804
2802
oneOf :
2805
2803
- type : ' null'
2806
2804
- type : string
2807
- userId :
2808
- type : string
2809
2805
relationships :
2810
2806
type : object
2811
2807
properties :
@@ -2838,8 +2834,6 @@ components:
2838
2834
oneOf :
2839
2835
- type : ' null'
2840
2836
- type : string
2841
- userId :
2842
- type : string
2843
2837
relationships :
2844
2838
type : object
2845
2839
properties :
@@ -2984,10 +2978,6 @@ components:
2984
2978
format : date-time
2985
2979
title :
2986
2980
type : string
2987
- authorId :
2988
- oneOf :
2989
- - type : ' null'
2990
- - type : string
2991
2981
published :
2992
2982
type : boolean
2993
2983
viewCount :
@@ -3034,10 +3024,6 @@ components:
3034
3024
format : date-time
3035
3025
title :
3036
3026
type : string
3037
- authorId :
3038
- oneOf :
3039
- - type : ' null'
3040
- - type : string
3041
3027
published :
3042
3028
type : boolean
3043
3029
viewCount :
You can’t perform that action at this time.
0 commit comments