|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
ACE12 HTTP headers validation |
« View previous topic :: View next topic » |
Author |
Message
|
gecs |
Posted: Sat Mar 01, 2025 8:48 pm Post subject: ACE12 HTTP headers validation |
|
|
 Acolyte
Joined: 14 Nov 2007 Posts: 58
|
Hi everybody,
I'm using REST API component and I've enabled "Message Validation", but it only validates the payload (body) and the HTTP headers aren't being validated (although they are defined in my contract - yaml)
This is my contract
Code: |
openapi: 3.0.0
info:
version: 1.0.0
title: Simple API
description: A simple API to illustrate OpenAPI concepts
servers:
- url: https://example.io/v1
paths:
/persons:
get:
description: Returns a list of persons
parameters:
- name: limit
in: query
description: Limits the number of items on a page
schema:
type: integer
- name: offset
in: query
description: Specifies the page number of the persons to be displayed
schema:
type: integer
responses:
'200':
description: Successfully returned a list of persons
content:
application/json:
schema:
type: array
items:
type: object
required:
- name
- age
properties:
name:
type: string
age:
type: integer
bithDate:
type: string
'400':
description: Invalid request
content:
application/json:
schema:
type: object
properties:
message:
type: string
post:
description: Lets a user post a new person
parameters:
- in: header
name: X-StringParam
required: true
schema:
type: string
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- name
- age
properties:
name:
type: string
age:
type: integer
bithDate:
type: string
additionalProperties: false
responses:
'200':
description: Successfully created a new person
'400':
description: Invalid request
content:
application/json:
schema:
type: object
properties:
message:
type: string
|
Any suggestions?
Additional info:
- ACE version: 12.0.8.0
- I know that ACE12 supports OpenApi 3.0. |
|
Back to top |
|
 |
fjb_saper |
Posted: Mon Mar 03, 2025 6:34 am Post subject: Re: ACE12 HTTP headers validation |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
gecs wrote: |
Hi everybody,
I'm using REST API component and I've enabled "Message Validation", but it only validates the payload (body) and the HTTP headers aren't being validated (although they are defined in my contract - yaml)
This is my contract
Code: |
openapi: 3.0.0
info:
version: 1.0.0
title: Simple API
description: A simple API to illustrate OpenAPI concepts
servers:
- url: https://example.io/v1
paths:
......
......
post:
description: Lets a user post a new person
parameters:
- in: header
name: X-StringParam
required: true
schema:
type: string
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- name
- age
properties:
name:
type: string
age:
type: integer
bithDate:
type: string
additionalProperties: false
responses:
'200':
description: Successfully created a new person
'400':
description: Invalid request
content:
application/json:
schema:
type: object
properties:
message:
type: string
|
Any suggestions?
Additional info:
- ACE version: 12.0.8.0
- I know that ACE12 supports OpenApi 3.0. |
Why would you expect the headers to be validated when you clearly ask for MESSAGE validation.
If you need header validation, you need to write your own routines to do that....
 _________________ MQ & Broker admin |
|
Back to top |
|
 |
gecs |
Posted: Sun Mar 09, 2025 10:21 am Post subject: Re: ACE12 HTTP headers validation |
|
|
 Acolyte
Joined: 14 Nov 2007 Posts: 58
|
Hi fjb_saper, thanks for your response.
Based on your question...
fjb_saper wrote: |
Why would you expect the headers to be validated |
OpenApi also allows validation of HTTP headers:
https://swagger.io/docs/specification/v3_0/describing-parameters/#header-parameters
fjb_saper wrote: |
when you clearly ask for MESSAGE validation. |
I thought that as "MESSAGE" it didn't just refer to the "BODY"
Thanks anyway, I think I'll keep investigating...  |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|